i am using my usercontrol in Updatepanel. i think thats why it is giving me error
Microsoft JScript runtime er开发者_StackOverflow中文版ror: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. Details: Error parsing near '
when i remove update panel it is working fine.But i want update panel compulsory. I kept my updatepanel as it is,but tried to call function from usercontrol(Homescroll.ascs) for scrolling as
<%ScriptManager.RegisterStartupScript(this, this.GetType(),"ale", scroll(),true); %>
in which scroll() is written in Homescroll.ascs.cs.
the function is getting called but is not getting displayed.
how to use ScriptManager for calling function which is written in .cs is there any error in this or any other way to do this.
please suggest me.
ScriptManager.RegisterStartupScript(this, this.GetType(), "ale", scroll(),true);
Do you mean that the function scroll() is a server-side (code-behind) function? It's not possible to do that this way, RegisterStartupScript only accepts javascript as code, and it should be in quotes and end with ";". You could try:
ScriptManager.RegisterStartupScript(this, this.GetType(), "ale", "scroll();", true);
Where scroll() is a javascript function.
Actually, i just now had some Scriptmanager problems when I forgot to add the semicolon (;) maybe that's all you have to add.
精彩评论