You must Sign In to post a response.
  • Category: ASP.NET

    Asp.net Editor data to save DB

    hi, Am using Asp.net Ajax editor.I need to Type all details with user requirement like (some Charter Bold,different color, points ,ect) in that editor and click to save DB(sql Server) and retrieve some other page.how to do.
  • #767048
    You have to use text datataype for the column which you want to store the data in sqlserver.]
    http://www.dotnetspider.com/resources/46083-HTML-Editor-in-extnet-Aspnet-C.aspx


    string Name = this.HTMLEditor1.Text;

    [\code]

    SRI RAMA PHANI BHUSHAN KAMBHAMPATI

  • #767050
    database can not save text formatting in its database, there are couple of ways to deal with such problem
    1. save data in RTF or HTML format, you can use Richtextbox control
    2. While saving to database you fetch value using innerHtml, property witch will give you text with html tags and after retrieving and loading in page you need to use, Server.HtmlDecode(strValue)
    methode to convert back to html format.
    where strValue is the varchar value with html tag '< b>bold< /b>'

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #767061
    Hi,

    As prasad said you can't save the formatted data in database, but you can save it HTML based result into database, what you can do is you can convert the formatted result into HTML format and then save it into database,

    For formatted data you have to use RichTextBox control using this we can format all types of formats using tinyMCE third party tool, you have to download the supported files and then include it into your project, then build the application like below,

    http://www.aspsnippets.com/Articles/RichTextBox-Example-using-Free-TinyMCE-Editor-in-ASPNet.aspx

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


  • Sign In to post your comments