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. How to Format Text in ASP.net ?????????

How to Format Text in ASP.net ?????????

Scheduled Pinned Locked Moved ASP.NET
questioncsharphtmlasp-netdatabase
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.
  • T Offline
    T Offline
    THE SK
    wrote on last edited by
    #1

    Hi All I have a requirement similar to that seen on codeproject website. I have a requirement which will allow the user to add HTML text in a control(most appropriate Textbox control in multiline mode) and then save it in a file or database.The text will be displayed later when the user visits the page. And I want to allow only some HTML tags not all. For eg Codeproject allows the tag for code and pre

    And if I write a script alert("Hello world"); tag is ignored in codeproject. 1.How can I achieve this???? And also when we submit the article on codeproject we add the text in textbox control but when our article is published we see our article on a page not in a control(label). 2.How is this achieved?????????? Please provide guidance for the above two requirements Thanks The SK</x-turndown>

    A 1 Reply Last reply
    0
    • T THE SK

      Hi All I have a requirement similar to that seen on codeproject website. I have a requirement which will allow the user to add HTML text in a control(most appropriate Textbox control in multiline mode) and then save it in a file or database.The text will be displayed later when the user visits the page. And I want to allow only some HTML tags not all. For eg Codeproject allows the tag for code and pre

      And if I write a script alert("Hello world"); tag is ignored in codeproject. 1.How can I achieve this???? And also when we submit the article on codeproject we add the text in textbox control but when our article is published we see our article on a page not in a control(label). 2.How is this achieved?????????? Please provide guidance for the above two requirements Thanks The SK</x-turndown>

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      Use Regular Expression to select from your html the part you want to show and what you dont want to... Something like this <TAG\b[^>]*>(.*?)</TAG> (there are lot to improve in this expression) Choose appropriate regex to select the part to omit. :)

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Windows7 API Code Pack
      Simplify Code Using NDepend
      Basics of Bing Search API using .NET

      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