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. restict the html tags

restict the html tags

Scheduled Pinned Locked Moved ASP.NET
questionhtmltools
2 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.
  • J Offline
    J Offline
    jithbiz0033
    wrote on last edited by
    #1

    Hi guys, In my project I have to use a text area in which the description is entered. I want to restrict the users to use the html and script tags. I would like to allow the following tags bold , break , paragraph and underline. What is the coding that I have to use? If anybody knows the answer or have any suggestions , please reply. Thanks Jith

    C 1 Reply Last reply
    0
    • J jithbiz0033

      Hi guys, In my project I have to use a text area in which the description is entered. I want to restrict the users to use the html and script tags. I would like to allow the following tags bold , break , paragraph and underline. What is the coding that I have to use? If anybody knows the answer or have any suggestions , please reply. Thanks Jith

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Use a regular expression validator to not allow any other tags. Then make sure you also write code in your code behind to strip any other tags that may exist, as validators can be bypassed by a determined user.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      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