Using Ajax control in User Control (ascx) [modified]
-
Tach experts .. I have ne problem where I do not know to solve that... I have a control that is added in a page. Basically it is a Content Management System. It selects a new page and can add different controls. In the control itself, I use a ModalPopupvon Ajax, but who needs a script manager. Now I wonder whether in the side where the control is already added a ScriptManager exists otherwise I add one. Here
void AddScriptMagnager()
{
//get the existing ScriptManager if it exists on the pageScriptManager \_scriptMan = ScriptManager.GetCurrent(this.Page); if (\_scriptMan == null) { //create new ScriptManager and EnablePartialRendering or whatever \_scriptMan = new ScriptManager(); \_scriptMan.EnablePartialRendering = true; \_scriptMan.EnableScriptLocalization = true; if (this.MuMPage.Page.Form != null) { foreach (Control ctrl in this.MuMPage.Page.Form.Controls) { this.MuMPage.Page.Controls.Add(\_scriptMan); } } } }
I always get the error that a Extendersteuerelemente may not be registered before PreRender. I appreciate any help and thanks a lot in advance.
modified on Monday, June 21, 2010 9:02 AM
-
Tach experts .. I have ne problem where I do not know to solve that... I have a control that is added in a page. Basically it is a Content Management System. It selects a new page and can add different controls. In the control itself, I use a ModalPopupvon Ajax, but who needs a script manager. Now I wonder whether in the side where the control is already added a ScriptManager exists otherwise I add one. Here
void AddScriptMagnager()
{
//get the existing ScriptManager if it exists on the pageScriptManager \_scriptMan = ScriptManager.GetCurrent(this.Page); if (\_scriptMan == null) { //create new ScriptManager and EnablePartialRendering or whatever \_scriptMan = new ScriptManager(); \_scriptMan.EnablePartialRendering = true; \_scriptMan.EnableScriptLocalization = true; if (this.MuMPage.Page.Form != null) { foreach (Control ctrl in this.MuMPage.Page.Form.Controls) { this.MuMPage.Page.Controls.Add(\_scriptMan); } } } }
I always get the error that a Extendersteuerelemente may not be registered before PreRender. I appreciate any help and thanks a lot in advance.
modified on Monday, June 21, 2010 9:02 AM
[CODE] There is a defined tag for this, <pre> implemented by clicking the "code block" toolbar item directly above this textarea. Please correct your post and read the posting guidelines for this site.
I know the language. I've read a book. - _Madmatt
-
Tach experts .. I have ne problem where I do not know to solve that... I have a control that is added in a page. Basically it is a Content Management System. It selects a new page and can add different controls. In the control itself, I use a ModalPopupvon Ajax, but who needs a script manager. Now I wonder whether in the side where the control is already added a ScriptManager exists otherwise I add one. Here
void AddScriptMagnager()
{
//get the existing ScriptManager if it exists on the pageScriptManager \_scriptMan = ScriptManager.GetCurrent(this.Page); if (\_scriptMan == null) { //create new ScriptManager and EnablePartialRendering or whatever \_scriptMan = new ScriptManager(); \_scriptMan.EnablePartialRendering = true; \_scriptMan.EnableScriptLocalization = true; if (this.MuMPage.Page.Form != null) { foreach (Control ctrl in this.MuMPage.Page.Form.Controls) { this.MuMPage.Page.Controls.Add(\_scriptMan); } } } }
I always get the error that a Extendersteuerelemente may not be registered before PreRender. I appreciate any help and thanks a lot in advance.
modified on Monday, June 21, 2010 9:02 AM
Add where are you calling the AddScriptManager method? Obviously no in the PreRender event handler. The common implementation is to include a ScriptManger in the master page so it is not necessary to be included in child pages and is available for use.
I know the language. I've read a book. - _Madmatt
-
Add where are you calling the AddScriptManager method? Obviously no in the PreRender event handler. The common implementation is to include a ScriptManger in the master page so it is not necessary to be included in child pages and is available for use.
I know the language. I've read a book. - _Madmatt
-
You wrote the master page correct? Add a ScriptManager! If you did not write the master page then the author probably did not intend for Ajax to be used in this manner
I know the language. I've read a book. - _Madmatt
-
You wrote the master page correct? Add a ScriptManager! If you did not write the master page then the author probably did not intend for Ajax to be used in this manner
I know the language. I've read a book. - _Madmatt
Nope, i c´ant! This is Standart site for everysite inour CMS. I'm trying to do exactly that! Just when none is there in the page where I try to add the control at runtime and add a Script Manager. And i get Collection was modified; enumeration operation may not execute.
-
Nope, i c´ant! This is Standart site for everysite inour CMS. I'm trying to do exactly that! Just when none is there in the page where I try to add the control at runtime and add a Script Manager. And i get Collection was modified; enumeration operation may not execute.
-
HELLO, I now have a template contains a script manager. but I get this error message but still Extender controls may not be registered after PreRender
HELLO, the error tells you what to do
I know the language. I've read a book. - _Madmatt
-
HELLO, the error tells you what to do
I know the language. I've read a book. - _Madmatt
-
Can you do nothing on your own? Go to the address bar of your browser and type, www.google.com, then click GO.
I know the language. I've read a book. - _Madmatt
-
Can you do nothing on your own? Go to the address bar of your browser and type, www.google.com, then click GO.
I know the language. I've read a book. - _Madmatt