Hey Buddies!
Please let me know, how to show alert message in web forms (in a catch block)?
Alert message in web forms ?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dipankar BiswasRank #992 · 2K reputationPosted Jul 31, 2014, 3:06 AM EDT
{
MessageBox.Show(e.Message);
}
or...
private void Btn_Click(object sender, EventArgs e)
{
try
{
int a = 10;
int b = 0;
int r = a/b;
}
catch (Exception exception)
{
String scriptText = "alert('Error - " + exception.Message + "')";
ClientScript.RegisterOnSubmitStatement(this.GetType(),
"ErrorAlert", scriptText);
}
}
or..
catch
{
Response.Write("");
Response.Write("")
;
}