Click here to Skip to main content
15,117,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a form that will display an alert message when the user clicks on the submit button. How can i change the "OK and Cancel" buttons to say Yes and No? Plus I get the error from my browser that says it will have to resend the information. Why Am I getting this?

Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "if(confirm('You Have Successfully Submitted the Cohort! If you have Additional Cohorts Please Click Cancel to Enter another Cohort.') == true){ location.reload();}else{location.href='Gradrate.aspx';}", true);

1 solution

refer below links:-
Create your own confirm box like:-[^]

and for asking about resend refer this:-[^]
Computer Wiz99 13-Jan-14 8:49am
Trushnak, Thanks for the links but is there a way I can convert this into C#? I don't know js.
Karthik_Mahalingam 13-Jan-14 9:25am
5! jsfiddle awesome ...
Computer Wiz99 13-Jan-14 9:51am
Do you know how to write the same code in C#? Or change the code I have to have the yes and no buttons?
TrushnaK 13-Jan-14 23:56pm
@ Computer wiz99:- learn jQuery introduction and how to use jQuery with ASP.NET Master page and simple pages from this link. its simple

once you added the jquery in aspx page then call that alert box as you called.
TrushnaK 13-Jan-14 23:56pm
Thanks Karthik....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900