----------------.aspx--------------
JAVASCRIPT FUNCTION
function alertClick(Details)
{
alert(Details)
return false;
}
.CS
string alert = "Enter Atleast One Debit Type and One Credit Type Ledger";
RegisterClientScriptBlock("gridcount", "<script Language='javascript'>window.onload = function(){return alertClick('" + alert + "');}</script>");
return;
---------------- OR
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());
}
Comments
Post a Comment