HTML formatting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Garima12
    New Member
    • Mar 2007
    • 58

    HTML formatting

    I want to format all kind of input in text area like line break, numbered list etc whatever user enters just like if I'm writting right now in text area(on bytes) and it will printed on screen as I'm entering. Is there any inbuilt function in .net framework by which I can achieve this functionality? I'm working on web site where user will enter some detailed description in text area. Now user can input text which may contain line break, list, etc. I will store this in database and will retrieve on page as per the query fired from web page. But the problem is when user enters the text in text area and clicks submit, it gets stored in database in incorrect format like all the lines, bulleted lists are stored in the continuation without formatting. I don't bother how it gets stored in database but concerned about putting on the page after fetching from database in the same format as user entered previously.
    Thanks.
  • yarbrough40
    Contributor
    • Jun 2009
    • 320

    #2
    Look at the StringReader/StringWriter classes or the Replace() function. What you ultimately need to do is modify the text when the HTML is created, for instance making double spaces in the text now show as a built in function e.g. "VbCrlf" or "Chr(10) & Chr(13)". Or you could replace it with an HTML tag such as "<br />" or "<p />" etc.

    That is the way I handle these things... perhaps one of the Bytes site admins can explain how it works in this forum... if I hit Return while I type in this box right now, it ultimately renders on the board as a carriage return - I have no idea how they are handling that... anyone?

    Comment

    • Garima12
      New Member
      • Mar 2007
      • 58

      #3
      Thank you yarbrough40.

      Comment

      Working...