Wednesday, June 29, 2011

How to configure FCK Editor in c# [ Integrating FCKeditor in ASP.NET, how to use FCKeditor in, FCKEditor and ASP.NET, How to Download and install FCKeditor ASP.NET]

Download FCK Editor FCKeditor 2.6.6, released on 15 February 2010.
You can find editor from following link:

2) Now add follwoing key field in web.config file

<add key="FCKeditor:UserFilesPath" value="image/"/>
This will create folder in location your site +  "FCKeditor\editor\filemanager\browser\default\connectors\aspx\image\"when you upload image

3) Now you need to see priview on eiditor window.
for this i modify file
Add replaced follwoing code
Orignal code:
e.src = GetE('txtUrl').value ;
SetAttribute( e, "_fcksavedurl", GetE('txtUrl').value ) ;

Replaced By :

var srouce = String(document.location).substr(0,String(document.location).indexOf('/editor/'));
srouce = srouce + '/editor/filemanager/browser/default/connectors/aspx/'+ GetE('txtUrl').value;

e.src = srouce;
SetAttribute( e, "_fcksavedurl",srouce ) ;

The srouce contains the complete qulaify path. now you can modify image path in C# code.

4) In Same way you can
 for flash upload.

Orignal Code  SetAttribute( e, 'src', GetE('txtUrl').value ) ;
Modified code.
SetAttribute( e, 'src', srouce) ;

5) Now set aspx for variables _FileBrowserLanguage & _QuickUploadLanguage

6) You can customize FCK Editor Toolbar button from
 this is also in FCKeditor\fckconfig.js.

7) Configure in Website.

a) Add FCK editor DLL inn your website.

b) Add FCK editor in tollbar menu.
c) Drag and drop FCK Editorr on your page.


<FCKeditorV2:FCKeditor ID="FCKeditor1" BasePath="FCKeditor/" runat="server" Height="600"></FCKeditorV2:FCKeditor>
 Set the base path propery for FCK Editor so it can access its directory.

@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

How to script manager Async Post Back Timeout on runtime

If you have script manager on Master page and need to exceed AsyncPostBackTimeout only on specific page than.
add this code line  in page_load event of your page.

ScriptManager _scriptMan = ScriptManager.GetCurrent(this);
_scriptMan.AsyncPostBackTimeout = 3600 * 15;

This will set AsyncPostBackTimeout upto 15 minutes.