I need alert boxes to let the user know of successful entry or data conflicts. I've tried the following and I get no errors and no alerts.
In the Save_Click:
ClientScript.RegisterStartupScript
(GetType(), "Javascript", "javascript: UpdateComplete(); ", true);
also...
ClientScript.RegisterClientScriptBlock(GetType(), "Javascript",
"<script>alert('Record Added Successfully')</script>");
also...
Save.Attributes.Add("onclick","return ReqField1Validator()");
I've used GetType and TypeOf both.
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "alert", "alert('See me?');", true);
return;
I've also tried the very popular suggestion
Response.Write("<script>alert('Hello');</script>");
and nothing works. I've tried many variations on these, moved them to the Updated method and the click method and all over and nothing ever happens.
Can anyone tell me what I'm doing wrong or what I'm overlooking? Thanks for your time and patience.
I need alert boxes to let the user know of successful entry or data conflicts. I've tried the following and I get no errors and no alerts.
In the Save_Click:
ClientScript.RegisterStartupScript
(GetType(), "Javascript", "javascript: UpdateComplete(); ", true);
also...
ClientScript.RegisterClientScriptBlock(GetType(), "Javascript",
"<script>alert('Record Added Successfully')</script>");
also...
Save.Attributes.Add("onclick","return ReqField1Validator()");
I've used GetType and TypeOf both.
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "alert", "alert('See me?');", true);
return;
I've also tried the very popular suggestion
Response.Write("<script>alert('Hello');</script>");
and nothing works. I've tried many variations on these, moved them to the Updated method and the click method and all over and nothing ever happens.
Can anyone tell me what I'm doing wrong or what I'm overlooking? Thanks for your time and patience.
Share Improve this question asked May 10, 2013 at 16:45 R_ScottR_Scott 1433 silver badges14 bronze badges 2- where you are writting these codes – Amit Singh Commented May 10, 2013 at 16:49
- 2 Is there a pop up blocker blocking it? – epascarello Commented May 10, 2013 at 16:49
1 Answer
Reset to default 5here buddy,
string script = "alert('its working now!')";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "its working", script, true);
just tested it now and guarantee its working
regarsd