In this I am explaining how to display Message Boxes in ASP.Net using JavaScript. ASP.Net. With the use of JavaScript alert we can display messages on different events in an ASP.Net Web Application.
C# code is given Below....
C# code is given Below....
protected void Page_Load(object sender, EventArgs e)
{
string message = "Hello! Mudassar.";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.onload=function(){");
sb.Append("alert('");
sb.Append(message);
sb.Append("')};");
sb.Append("</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString());
}


No comments:
Post a Comment