I have two FCKeditors on a single ASPX page. These two editors need to point to two different UserFilesPaths. I have tried splitting the editors into two different pages and using the Session["FCKeditor:UserFilesPath"]="new path" in the Page_Init for each page however it seems that whichever page is accessed first becomes the UserFilesPath value for both editors regardless of what I set in the session from that point forward. Any ideas on either getting two editors to co-exist on the same page (and having different UserFilesPath values) or changing the UserFilesPath value for each page?
EG:
Page1.aspx
--------------
protected void Page_Init(object sender, EventArgs e)
{
if (Session["FCKeditor:UserFilesPath"] == null)
{
Session.Add("FCKeditor:UserFilesPath", ConfigurationSettings.AppSettings["Path1:FCKeditor:UserFilesPath"]);
}
else
{
Session["FCKeditor:UserFilesPath"] = ConfigurationSettings.AppSettings["Path1:FCKeditor:UserFilesPath"];
}
}
Page2.aspx
-------------
protected void Page_Init(object sender, EventArgs e)
{
if (Session["FCKeditor:UserFilesPath"] == null)
{
Session.Add("FCKeditor:UserFilesPath", ConfigurationSettings.AppSettings["Path2:FCKeditor:UserFilesPath"]);
}
else
{
Session["FCKeditor:UserFilesPath"] = ConfigurationSettings.AppSettings["Path2:FCKeditor:UserFilesPath"];
}
}
EG:
Page1.aspx
--------------
protected void Page_Init(object sender, EventArgs e)
{
if (Session["FCKeditor:UserFilesPath"] == null)
{
Session.Add("FCKeditor:UserFilesPath", ConfigurationSettings.AppSettings["Path1:FCKeditor:UserFilesPath"]);
}
else
{
Session["FCKeditor:UserFilesPath"] = ConfigurationSettings.AppSettings["Path1:FCKeditor:UserFilesPath"];
}
}
Page2.aspx
-------------
protected void Page_Init(object sender, EventArgs e)
{
if (Session["FCKeditor:UserFilesPath"] == null)
{
Session.Add("FCKeditor:UserFilesPath", ConfigurationSettings.AppSettings["Path2:FCKeditor:UserFilesPath"]);
}
else
{
Session["FCKeditor:UserFilesPath"] = ConfigurationSettings.AppSettings["Path2:FCKeditor:UserFilesPath"];
}
}
Re: Two Editors on the Same Page - Need Different UserFilesPath
I believe that I have found a solution that will work for editors on two different pages (though having them co-exist on a single page with different values would be nice). After changing search terms for a while, I finally found the work around in the following thread: viewtopic.php?f=6&t=1679&p=4117&hilit=+UserFilesPath+UserFilesPath+Runtime#p4117
What I have done is added the code to the Page_Init method of the master pages for the two editors:
EG:
Page1.aspx
--------------
protected void Page_Init(object sender, EventArgs e)
{
System.Configuration.ConfigurationManager.AppSettings["FCKeditor:UserFilesPath"] = ConfigurationSettings.AppSettings["Path1:FCKEditor:UserFilesPath"];
}
Page2.aspx
--------------
protected void Page_Init(object sender, EventArgs e)
{
System.Configuration.ConfigurationManager.AppSettings["FCKeditor:UserFilesPath"] = ConfigurationSettings.AppSettings["Path2:FCKEditor:UserFilesPath"];
}
While this approach is not optimal, it seems to work.