You've probably used ClientScript.RegisterStartupScript in your ASP.NET application and it works just fine. However, if you try it within an UpdatePanel control, you would notice that it simply doesn't execute.
The solution to this problem is to use ScriptManager.RegisterStartupScript instead. You can call it like so: ScriptManager.RegisterStartupScript(updatePanel1, updatePanel1.GetType(), "key", "alert('My script');", true);
look at this link, you might find an answer: http://www.systemdeveloper.info/2014/01/fileupload-control-in-update-panel.html or in http://www.systemdeveloper.info/2014/02/how-do-i-add-javascript-updatepanel-in.html
Nice one. Saved me tons of time.
ReplyDeleteAlways glad to be of service!
ReplyDeleteAwesome. You are legend
ReplyDeleteI owe you an afternoon.
ReplyDeleteThanks a ton nitin.
ReplyDeleteThanks for the solution :)
ReplyDeletelook at this link, you might find an answer:
ReplyDeletehttp://www.systemdeveloper.info/2014/01/fileupload-control-in-update-panel.html
or in
http://www.systemdeveloper.info/2014/02/how-do-i-add-javascript-updatepanel-in.html