I am trying to add an alert box so that the user can choose either Yes or No or Ok and Cancel, but it is not working correctly. It is my first time I am trying to do this. I am using visual studio 2010. I am not sure if my code is correct. Can anyone please guide me if I am mistaken.
This is my code:
private void AlertWithOption()
{
Response.Write("<script language='javascript'>");
Response.Write("function onsub() ");
Response.Write("{ ");
Response.Write("var where_to= confirm: (\"Are You sure?\")");
Response.Write("if (where_to== true)");
Response.Write("{ ");
Response.Write("return true");
Response.Write(" }");
Response.Write("else ");
Response.Write("{");
Response.Write("return false;");
Response.Write(" } ");
Response.Write("} ");
Response.Write("</script>");
}