What I'm trying to do is, when I click on the button it should show an alert box. Here is the code.
protected void btnAdd_Click(object sender, EventArgs e)
{
string script = "<script type=\"text/javascript\">alert('abc 1');
</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert 1",
script);
Response.Redirect("~/Index.aspx");
}
It is working perfectly but when I put this same code in another page it does not work.
what are the things I have to look into? any suggestion please?