locked
Problem reloading html text to htmleditorextender and keeping html format RRS feed

  • Question

  • User-597499662 posted

    I am inserting an image into textbox and saving into database it is working perfectly but when I am trying to load date in text box cross 'x' image is shown.

    before insert html '<img src="/QuestionImage/B1811B39125237C66EBF3B61CA424213.png">'

    after load html '<img src="&amp;amp;#x2F;QuestionImage&amp;amp;#x2F;B1811B39125237C66EBF3B61CA424213&amp;amp;#x2E;png">'

    I am using latest ajaxcontroltoolkit Verson 16.1.1.0

    Friday, August 26, 2016 12:32 PM

All replies

  • User36583972 posted

    Hi wowmayur_11,

    According to your description , I found your image URL is incorrect format when after reload your page. So, I suspect the url value is incorrect when you save the picture into the database.

    I suggest you can check your application as the following options.

    1. Check URL value, whether contained some useless char when you save image in database; 

    2. I use the function of Server.HtmlDecode to escape the url , remove useless char , then translate url , it will show correctly.

    Sample Code:

                string ff = Server.HtmlDecode("&amp;#x2F;QuestionImage&amp;#x2F;B1811B39125237C66EBF3B61CA424213&amp;#x2E;png");
                Response.Write(ff);
    

    Best Regards,

    Yohann Lu

    Monday, August 29, 2016 10:33 AM
  • User-597499662 posted

    Thank for reply

    You are missing img tag.

    Value is store in database after encoding.

    value is return by htmleditorextender is '<img src="&amp;amp;#x2F;QuestionImage&amp;amp;#x2F;B1811B39125237C66EBF3B61CA424213&amp;amp;#x2E;png">

    to store in database I am performing Server.HtmlEncode(txtText.Text)

    and to display txtText.Text=Server.HtmlDecode(value).

    Tuesday, August 30, 2016 10:56 AM
  • User-1642217485 posted

    Hi wowmayur_11,

    According to your description , As far as I know this issue is appearing when you save the URL of an image in the database , maybe caused by messy code happened in translate code . you can try to reset the charset  to UTF-8 or others . if it doesn't solve your problem , please give me more detail code .

    Best Regards,

    Eric Du

    Wednesday, August 31, 2016 2:46 PM
  • User-597499662 posted

    Thank for reply.

    not working same problem.

    string str=Server.HtmlEncode(txtText.Text);
    // to display save value 
    txtText.Text=Server.HtmlDecode(value);
    

    for now there is only image in text box.

    Saturday, September 3, 2016 10:55 AM
  • User-597499662 posted

    I have try online on below link

    https://ajaxcontroltoolkit.devexpress.com/HtmlEditorExtender/HtmlEditorExtender.aspx

    when I upload Image I am able to see the image when I click on submit content then I image is not visible.

    Before any suggestion please try it thank. 

    Tuesday, November 15, 2016 4:32 AM