Wednesday, December 29, 2010

Alert window Code

ScriptManager.RegisterClientScriptBlock(this.GetType(), "ClientScript", "window.alert('Vous ne pouvez pas supprimer un client utilisez le champ Statut');", True);"YourMessageHere");

write this query in at the end in submit button
Response.Write("<script language=javascript>alert('you have successfully posted your query');</script>");
...........................................

code Behind page of Controls
Alert.Show("You do not have write permission to this file");
.............................................

property of control write as....
OnclientClick=alert('submitted successfully..');

-----------------------------------
  -----------------------------------------------------------------------------------------------------

for form authentication on clicking Button:

------------------------------------------------------------------------------------
Alert and then redirect to next page
-----------------------------------
ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "alert('Employee added Successfully...!'); window.location.href = 'Add Employees.aspx';", true);
or
lbl_alert.Text = "<script>" + Environment.NewLine + "alert('Employee added Successfully...!');window.location('Add Employees.aspx');</script>";

http://www.velocityreviews.com/forums/t548336-show-alert-box-and-then-redirect.html




-----------------------

No comments: