Page.ClientScript.RegisterStartupScript does not fire on button click event
in one ascx control there is a button, and i write onclick event of that
now in onclick event i written
Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script type=\"text/javascript\">alert('hi');</script>");
but it doesnot fire alert message
what's the problem
thanks
try this:
Page.ClientScript.RegisterStartupScript(this.GetType(), "Error","alert('hi');", true);
there isa no need of <script> tag if you use Page.ClientScript.RegisterStartupScript
the correct synatx is :
Page.ClientScript.RegisterStartupScript(this.GetType(), "Error","alert('hi');", true);
no need of <script> tag
Try this way instead.
System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Test", "javascript:alert('Hi there!');", true);
- How do we change the color of the gridviewrow depends on the data?
- Nested Master-Detail gridview
- How can i insert code for Itemtemplate of DataList control
- Could not find control 'xxx' in ControlParameter 'yyy'
- Gridview not displaying data
- Nested GridView RowEditing Event
- dynamic url for hyperlink column in the grid
- Gridview Edit Template Drop Down Lists Cascading Possibility..?
- regarding DataNavigateUrlFormatString
- GridView / RowDataBound event not firing
Rss Feed