views:

31

answers:

2

I have a problem that seems like there should be a simple solution but haven't found it yet.

I have a pretty simple form that calls an action and passes it a FormCollection via HTTP Post.

The form works perfectly until I introduce < or > into the field. Then I end up on a blank page having skipped the Action altogether.

Need more information? Have any suggestions? Please help!

+2  A: 

Decorate your action with [ValidateInput(false)] attribute

Gregoire
Since this is going to be an internal application I may take this route but I am still curious and will explore the encoding route. Thanks!
Chompski
+1  A: 

You will want to encode these. AntiXSS has a library that encodes a variety of ways (because encoding for HTML, URL, XML, attributes, etc are all slightly different)

If you want to turn off security (not a good idea if you care about security), Hanselman has an article on that, too.

MatthewMartin
Appreciate the response. I have chosen the non-validation route at this time - since this is an internal app. But I plan on exploring your route later down the line. Thanks.
Chompski