shows only html code when pushing back button
9 posts
• Page 1 of 1
shows only html code when pushing back buttonI am using fckeditor with asp.net. When I make an update to a page, it displays fine and it saves fine. However, if I push the button to go back to the editor, the text no longer shows itself in wysiwyg mode, but instead is wrapped in html code. If I view the source, it renders all of those extra characters as well. I have to exit the page and get back in for it to show up normally. If I save while in the html code mode, it saves <h1>header</h1><p>stuff here</p> etc to the page. Is there a setting to auto refresh so that it renders correctly when I go back to the editor?
Thanks, Andy
|
Re: shows only html code when pushing back buttonYes... this happen to me too...
Please somebody help
|
Re: shows only html code when pushing back buttonI too am having this problem. I've tried reloading the page via javascript and it didn't help. Only manually hitting the refresh button seems to correct the text. The site I'm working on requires one to be able to go back and forth between pages and edit the contents of the FCKedit control.
Please help
|
Re: shows only html code when pushing back buttonI finally found something that worked for me. This is in ASP.NET.
In the Page_Load of the page I was going back to I added the following Response.Cache.SetCacheability(HttpCacheability.NoCache) The website I found this on was http://www.xtremevbtalk.com/showthread.php?t=296478 Hope this helps
|
Re: shows only html code when pushing back button
Thanks for the reply. I try to do this way but... For me it doesn't work because the request is to the same page. I'm using a multiview and in the first postback I show the fckeditor, in the next I show another content (a message for confirmation for example). When I use NoCache, nothing even the other field values are keep. I'm still lookin' for a solution...
|
Re: shows only html code when pushing back buttonHaving the same problem here with a customer site: entering text, storing it to the database is no problem. However, going back by using the Back button reveals the HTML tags around the text; users who inadvertently store the data again results in storing the tags to the database. This is highly undesirable.
The proposed solution does not work for us, however, due to the fact that we must be using the Back/Forward buttons and cannot interfere with the cache. Is there any alternative solution available? Any help highly appreciated. Cheers!
|
Re: shows only html code when pushing back buttonI ran into this same problem; hitting the backbutton in the browser causes the fckeditor to display the HTML code.
After debugging the code I've comeup with following solution; when the backbutton is press the information is not refetched but it is comming from the cache, which seems to store it in a HTMLEncoded form, so when the window loads we will have to HTMLDecode the message before display it, since HTMLDecoding will not do anything to normal texts ( initial created text in the editor) we can just apply it to all content. solution : Add following code to file: FCKEditor\editor\fckeditor.html window.onload = function() { // 25-11-2008 Han: Fixing the issue with the backbutton, when the back/forward button is hit then the html to display is // still HTMLEncoded which will cause the control to display html control sequences in the editor. // The easiest solution is probably to always htmldecode the value before it is beaing displayed in the editor, this can be done // using the statement below. // FCK.LinkedField.value=FCKTools.HTMLDecode(FCK.LinkedField.value); FCK.LinkedField.value=FCKTools.HTMLDecode(FCK.LinkedField.value); InitializeAPI() ; // existing code line ....... after adding the code line you will have to make sure that the javascript is downloaded to the client, so in your browser delete the local files ( tools->internet options->delete files). And then it should all work as expected, good luck Han
|
Re: shows only html code when pushing back buttonWhen the user hits the back button - and caching is enabled - the browser will restore the latest contents of the textarea that the FCK is associated with. So, before the page was unloaded one should make sure that this textarea is properly updated with the latest contents of the editor. This way, perhaps the editor will regain whatever it had before, when the back button is hit. However, when the page is being unloaded the DOM is not in a position of being correctly manipulated (I am not sure exactly what this means, but it is generally correct). So, the textarea will not be able to be updated correclty with the latest contents of the editor. To sum up one must find a way to update it before the unload event of the page!
I tried simply doing this via the window unload event but it doesn't work. Another solution would be by sending the contents of the FCK to the server and storing it somewhere so as to restore it later on. But this would only work if the user hits a submit button or something. If the user simply leaves the page then this cannot work...
|
Re: shows only html code when pushing back button
Brilliant! Worked a treat. Thanks Han.
|
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: MSN [Bot], Yahoo [Bot] and 1 guest