Good day,
I have a question regarding the usage of the StyleSheetManager in combination with Ajax Postbacks.
In some application scenarios we'd like to add stylesheets to the StyleSheets collection of the StyleSheetManager depending on the usercontrol we are loading after a javascript postback.
For instance:
- A button in an UpdatePanel is clicked
- An AJAX Postback occurs
- New Usercontrol is added to the controls collection of the Page
- Page_Init event of the new control is fired:
- The scriptmanager loads its newly added script after the AJAX postback.
- The StyleSheetManager doen't seem to load the newly added stylesheet.
It looks like the RadStyleSheetManager loads only the Stylesheets added to the collection when the page is fully loaded ( !IsPostBack ).
Is there any way we can let the stylesheetmanager update the stylesheets in the head section with the current StyleSheets collection after an ajax postback?
Thanks in advance.
Regards,
P. van de Kamp
Application Developer
I have a question regarding the usage of the StyleSheetManager in combination with Ajax Postbacks.
In some application scenarios we'd like to add stylesheets to the StyleSheets collection of the StyleSheetManager depending on the usercontrol we are loading after a javascript postback.
For instance:
- A button in an UpdatePanel is clicked
- An AJAX Postback occurs
- New Usercontrol is added to the controls collection of the Page
- Page_Init event of the new control is fired:
protected
void
Page_Init(
object
sender, EventArgs e)
{
RadStyleSheetManager.GetCurrent(Page).StyleSheets.Add(
new
StyleSheetReference(
"KaosCore.Style.Widgets.FeedWall.css"
,
"KaosCore"
));
RadScriptManager.GetCurrent(Page).Scripts.Add(
new
ScriptReference(
"KaosCore.Javascript.Widgets.FeedWall.js"
));
}
- The scriptmanager loads its newly added script after the AJAX postback.
- The StyleSheetManager doen't seem to load the newly added stylesheet.
It looks like the RadStyleSheetManager loads only the Stylesheets added to the collection when the page is fully loaded ( !IsPostBack ).
Is there any way we can let the stylesheetmanager update the stylesheets in the head section with the current StyleSheets collection after an ajax postback?
Thanks in advance.
Regards,
P. van de Kamp
Application Developer