Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problems passing HTML text to a database.

Problems passing HTML text to a database.

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-netdatabasehelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Quick
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • C Chris Quick

      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

      R Offline
      R Offline
      Rocky Moore
      wrote on last edited by
      #2

      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!"

      C 1 Reply Last reply
      0
      • R Rocky Moore

        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!"

        C Offline
        C Offline
        Chris Quick
        wrote on last edited by
        #3

        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...

        R 1 Reply Last reply
        0
        • C Chris Quick

          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...

          R Offline
          R Offline
          Rocky Moore
          wrote on last edited by
          #4

          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!"

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups