Avatar of Sukeshjph

asked on 

problem running scriptmanager.registerstartupscript in my page

i have got two update panels in my page in first updatepanel i have a gridview.in the 2nd updatepanel i have got a modalpopup extender.My scenario is something like this----

In my gridview i have a disable button on the click of which rowcommand event is fired for gridview in this i am calling the modalpopup.show method of the modalpopup extender to show the popup panel.

When the disables a perticular row of gridview by clicking on the disable button i am trying to execute a javascript method to show an alert message saying that " you have already disabled the posted ad"

but here i have written a javascript method like this
function StopDisable()

 alert("You have already Disabled the ad");

and in the rowcommand method i am calling the disable method which checks for the disable status by a viewstate key and then i am writing like this

ScriptManager.RegisterStartupScript(Page, Page.GetType(), "message", "<script>StopDisable()</script>", true);

but surprisingly this javascript method is not running.
i tried using external javascript in the scriptmanagerproxy (as i am using masterpage already i have an instance of scriptmanager in the masterpage).but still it shows me javascript error.

what may be the problem....can i not execute javascript methods from scriptmanager?
.NET Programming

Avatar of undefined
Last Comment

8/22/2022 - Mon