Update Panel and Registerstartupscript Bug...........
-
Hi every one I am facing a problem in my current project. The problem is I am unable to use RegisterStartupscript with the Update panel. The script does not run and I am unable to see it in the view source . These are the codes which i have tried. ScriptManager.RegisterStartupScript(this, this.GetType(), "Success", builder.ToString(), false); up->updatepanel ScriptManager.RegisterStartupScript(up1, up1.GetType(), "hello", "alert('Hello!')", true); ClientScript.RegisterStartupScript(this.GetType(), argScriptId, builder.ToString(),true); These all I have tried but nothing seems to be working. however If i remove the updatepanel then I am able to see the script in view source. and the code is running fine. Please send me the solution if any one have. Sandesh Khare :(( Software Enginner ISTS Infotech Solutions
-
Hi every one I am facing a problem in my current project. The problem is I am unable to use RegisterStartupscript with the Update panel. The script does not run and I am unable to see it in the view source . These are the codes which i have tried. ScriptManager.RegisterStartupScript(this, this.GetType(), "Success", builder.ToString(), false); up->updatepanel ScriptManager.RegisterStartupScript(up1, up1.GetType(), "hello", "alert('Hello!')", true); ClientScript.RegisterStartupScript(this.GetType(), argScriptId, builder.ToString(),true); These all I have tried but nothing seems to be working. however If i remove the updatepanel then I am able to see the script in view source. and the code is running fine. Please send me the solution if any one have. Sandesh Khare :(( Software Enginner ISTS Infotech Solutions
sandesh khare wrote:
ScriptManager.RegisterStartupScript(this, this.GetType(), "Success", builder.ToString(), false); up->updatepanel ScriptManager.RegisterStartupScript(up1, up1.GetType(), "hello", "alert('Hello!')", true); ClientScript.RegisterStartupScript(this.GetType(), argScriptId, builder.ToString(),true); These all I have tried but nothing seems to be working.
This would work only if the Page postbacks. But in AJAX, no postbask is going to happen. You have try with Client Scripting provided by the Script Manager like,
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(funcBeginRequest); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(funcEndRequest); function funcBeginRequest(){ } function funcEndRequest(){ }
Similarly for Page onload (StartupScript) can also be handler using add_pageLoad() method. Refer Client Scripting help in www.asp.net
[Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot
-
sandesh khare wrote:
ScriptManager.RegisterStartupScript(this, this.GetType(), "Success", builder.ToString(), false); up->updatepanel ScriptManager.RegisterStartupScript(up1, up1.GetType(), "hello", "alert('Hello!')", true); ClientScript.RegisterStartupScript(this.GetType(), argScriptId, builder.ToString(),true); These all I have tried but nothing seems to be working.
This would work only if the Page postbacks. But in AJAX, no postbask is going to happen. You have try with Client Scripting provided by the Script Manager like,
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(funcBeginRequest); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(funcEndRequest); function funcBeginRequest(){ } function funcEndRequest(){ }
Similarly for Page onload (StartupScript) can also be handler using add_pageLoad() method. Refer Client Scripting help in www.asp.net
[Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot
BOTs - running in my mind wrote:
This would work only if the Page postbacks. But in AJAX, no postbask is going to happen.
Hi Venkat, Here i am getting confused, even if you are using ajax postback is going to heppen it will go to page load and you can see isPostback property that will show you true ... In what sence you are saying that postback is not going to happen ?
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
BOTs - running in my mind wrote:
This would work only if the Page postbacks. But in AJAX, no postbask is going to happen.
Hi Venkat, Here i am getting confused, even if you are using ajax postback is going to heppen it will go to page load and you can see isPostback property that will show you true ... In what sence you are saying that postback is not going to happen ?
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
playing with bugs ) wrote:
Here i am getting confused, even if you are using ajax postback is going to heppen it will go to page load and you can see isPostback property that will show you true ... In what sence you are saying that postback is not going to happen ?
Hi Sandeep, You are talking about Server-side Page Load. But I mentioned the Client Side page load (onload event), since the StartupScript is going to do the same.
[Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot
-
playing with bugs ) wrote:
Here i am getting confused, even if you are using ajax postback is going to heppen it will go to page load and you can see isPostback property that will show you true ... In what sence you are saying that postback is not going to happen ?
Hi Sandeep, You are talking about Server-side Page Load. But I mentioned the Client Side page load (onload event), since the StartupScript is going to do the same.
[Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot
Yup OK that's what i got confused :)
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "