Feb21

Disabling input validation in MVC2 using ASP.NET 4.0 (Part II)

Tags: .NET
This is the second part of “Disabling input validation in MVC2 using ASP.NET 4.0”, in the first part we saw how to disable the input validation, to upload, for example, html code.
The problem with that is that we disabled the validation for all fields in the form, so all the other fields (that might not contain html) can be “hacked” with htm... [Read More]

Feb08

Disabling input validation in MVC2 using ASP.NET 4.0

Tags: .NET, Arquitectura
Imagine you need to make a web page in which you can edit HTML and send it back to the server (an html editor), so you place the input and when you submit the form, the famous “A potentially dangerous Request.Form value was detected from the client” error rises, so you try the old way and you set the input validation to false in the page.
No... [Read More]

Feb03

MOSS cache in https sites

Tags: .NET, MOSS/WSS
There is quite odd behavior with MOSS cache: Imagine you create a site with two areas, one that can be accessed by http and one which must be accessed using https.
So you need to enable https in your site, etc… Alright, so how do you make the users access the secure zone by using https, you do two things:
You link to the secure zon... [Read More]

Feb03

Creating a custom RSS for your site

Tags: Proyectos, Internet, .NET, Community
Sometimes you need to create a custom RSS feed for your site, and the product you’re using (MOSS, Umbraco, a custom development,…) does not provide what you exactly need. So you start thinking about building your own feed.
The first attempt is to build the XML yourself, but you’ll find that it can be a little tricky, but think a while… since... [Read More]

Jan17

Dynamically Signing Downloaded Pdfs using an HttpHandler

Tags: .NET, Proyectos
Sometimes you have to perform some kind of operations on the files the user downloads from your site, for example you might need to put a watermark on the documents or images.
In this particular case we are going to sign a pdf file to prevent users modifying the file without being noticed. This is a very useful feature when you distribute le... [Read More]

Jan16

Chuck Norris can divide by zero... and so can .NET!

Tags: .NET
At first this was a big WTF! Here is the screen shot, pay attention to the last line of code and the values of the items being divided (13 by 0) :

While trying to modify the class PaginatedList from NerdDinner, I added that constructor and while debugging I saw the weird value in Total Pages! It seems I was dividing by 0 by mistake... [Read More]

Jan14

Using DataAnnotations metadata with Linq2Sql entities

Tags: Arquitectura, .NET
One of the most useful features for CRUD screens that the framework (3.5 & 4.0) provides is DataAnnotations  attributes, by using them you can add metadata to your classes that describes, for example, if a field is required, the maximum length of an string and things so.
Combining that with ASP.NET Dynamic Data technologies can save a gr... [Read More]

 Next >>