Problems passing HTML text to a database.
-
I have an application that I need to be able to copy and paste HTML text into a text box. The problem that I have is that ASP.NET seems to detect this and block this ability. I am using a validator for the textbox and I am getting this exception
System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client
It is vital that I allow the client to write HTML code to the database. Are there any workarounds for this behaviour? Thanks -
I have an application that I need to be able to copy and paste HTML text into a text box. The problem that I have is that ASP.NET seems to detect this and block this ability. I am using a validator for the textbox and I am getting this exception
System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client
It is vital that I allow the client to write HTML code to the database. Are there any workarounds for this behaviour? ThanksThis is the ASP.NET validation that is watching over you to make sure you are not open to script attacks. Here is more information and the simple method to remove it: http://www.asp.net/faq/RequestValidation.aspx[^] I think maybe I should make a tip of this one ;) Rocky <>< www.HintsAndTips.com - Now with GMail Queue www.MyQuickPoll.com - 2004 Election poll is #33 www.GotTheAnswerToSpam.com "We plan for the future, we learn from the past, we live life in the present!"
-
This is the ASP.NET validation that is watching over you to make sure you are not open to script attacks. Here is more information and the simple method to remove it: http://www.asp.net/faq/RequestValidation.aspx[^] I think maybe I should make a tip of this one ;) Rocky <>< www.HintsAndTips.com - Now with GMail Queue www.MyQuickPoll.com - 2004 Election poll is #33 www.GotTheAnswerToSpam.com "We plan for the future, we learn from the past, we live life in the present!"
Thank you so much for this information! This will help tremendously! I agree, this would be a good tip, especially as this is a common procedure for many web apps. I wonder, how about exploring using regular expressions to validate user input. Hmm, could be interesting...
-
Thank you so much for this information! This will help tremendously! I agree, this would be a good tip, especially as this is a common procedure for many web apps. I wonder, how about exploring using regular expressions to validate user input. Hmm, could be interesting...
Yeah, they snuck this in on VS.2003 (.NET 1.1) and I was one that moved later from VS.NET 2002 to VS.NET 2003. After the change I noticed my www.HintsAndTips.com site failing out when posting tips. I use <LINK> and <FIX> for hyperlinks and Fixed text blocks in the tip postings. Once I found what they did to prevent me from shooting my own foot I could finally deal with it. Just wish they would have had a bit more content to their error message so you knew what it was referring to without spending hours finding out. For me I spent the time trying to see in my code how it could be failing and trying to figure out why I got the error only at certian times until I noticed it was when I was using tags ;) Rocky <>< www.HintsAndTips.com - Now with GMail Queue www.MyQuickPoll.com - 2004 Election poll is #33 www.GotTheAnswerToSpam.com "We plan for the future, we learn from the past, we live life in the present!"