hi i am building an application, and using just FCKEditor for formated HTML text, in ASP.NET. I made a page to get the these values and display. some sort of preview.aspx page to get preview of the changes i have made. But i am unable to get the values on preview.aspx page which is in previous directory.
Structure like this:
abc.com/admin/EditorPage.aspx => after editing the contents when i press the button preview he give values to
abc.com/preview.aspx
any one knows the solution please tell. I m in big trouble.
Regards,
Ali imran
Structure like this:
abc.com/admin/EditorPage.aspx => after editing the contents when i press the button preview he give values to
abc.com/preview.aspx
any one knows the solution please tell. I m in big trouble.
Regards,
Ali imran
Re: need to use FCK editor value on some Preview Page?
I have done this a few years ago and have been using ever since.
This will need to be modified a bit to work in multi browsers.
Works in IE.
here are some snippets you can start with:
Client Side:
<script type="text/javascript">
var objFCKInstance = null;
// called when FCKeditor is done starting..
function FCKeditor_OnComplete( editorInstance ){
objFCKInstance=editorInstance;
}
function doPreview(){
var html=objFCKInstance.GetHTML();
formPreview.PreviewHTML.value=html;
formPreview.PreviewDocTitle.value=document.all.DocTitle.value;
formPreview.PreviewTemplateID.value=document.all.TemplateID.value;
formPreview.submit();
}
</script>
<form name="formPreview" action="PreviewContent.asp" target="_new" method="post">
<input type="hidden" name="PreviewID" value="<%=ID%>">
<input type="hidden" name="PreviewSection" value="<%=SiteMapSection%>">
<input type="hidden" name="PreviewHTML" value="">
<input type="hidden" name="PreviewDocTitle" value="">
<input type="hidden" name="PreviewTemplateID" value="">
</form>
Server side
PreviewContent.asp
<%
'This can be any code that generates html to send back to the client
'This example uses my content management system dll but can be
'changed to use another method of creating the preview html
set DocMan=server.createobject("EZWEB.busrules")
'Get the HTML sent from the editor page
strHTML= request("PreviewHTML")
'S and R tags
strHTML=replace(strHTML,"+MYLT+","<")
strHTML=replace(strHTML,"+MYGT+",">")
strHTML=replace(strHTML,"+MYAMP+","&")
'Get document ID
id= request("ID")
DocTitle= replace(request("PreviewDocTitle"),"''","'")
'Which template to use in preview
TemplateID= request("PreviewTemplateID")
'Generate the preview
X=DocMan.index(ID,strHTML,DocTitle,TemplateID)
%>