public void Confirm(string message) { _Content = "<input type=\"hidden\" value=\"0\" name=\"" + ID + "_result\" />" + Environment.NewLine + "<script type=\"text/javascript\">" + Environment.NewLine + " if (confirm('" + ServerJScript.JSEncode(message) + "')) {" + Environment.NewLine + " document.forms[0]." + ID + "_result.value='" + WebMessageBoxResult.Ok + "'; }" + Environment.NewLine + " else {" + Environment.NewLine + " document.forms[0]." + ID + "_result.value='" + WebMessageBoxResult.Cancel + "'; }" + Environment.NewLine + " document.forms[0].submit(); " + Environment.NewLine + "</script>"; }
protected void DgStoreAuxCost_ItemCommand(object source, DataGridCommandEventArgs e) { // must be the add button - there is nothing else if (ValidateEntry(((TextBox)e.Item.FindControl("txtStoreAuxCost")).Text.Trim(), "Store")) { AddNewParm(e.Item, "Store"); } else { ServerJScript.JSAlert(this, "AuxCost parameter invalid - it must begin with Store and must be unique"); } }
private void NavigateClient(string page) { int orgId = Convert.ToInt32(Session["OrgID"]); var reader = DataCommand().Param("Action", "ByOrg").Param("OrgID", orgId).ExecuteReader("sselData.dbo.Department_Select"); bool noDept = !reader.Read(); if (noDept) { ServerJScript.JSAlert(Page, "Please add a department to the organization before adding clients."); } else { Response.Redirect(page); } }
public void Alert(string message) { _Content = "<script type=\"text/javascript\">alert('" + ServerJScript.JSEncode(message) + "');</script>"; }