|
Background page:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Fun_Test_Default: System.Web.UI.Page {
protected void Page_Load (object sender, EventArgs e) {
}
protected void btnSave_Click (object sender, EventArgs e) {
string strScript = "";
int resultNum = -1;
if (resultNum == -2) {
strScript = "<script> alert ('This contact already exists!'); </ script>";
Page.ClientScript.RegisterStartupScript (this.GetType (), "Prompt", strScript);
return;
} else if (resultNum == -1) {
strScript = "<script> alert ('Add failed!'); </ script>";
Page.ClientScript.RegisterStartupScript (this.GetType (), "Prompt", strScript);
return;
} else {
strScript = "<script> alert ('Add successfully!');
Page.ClientScript.RegisterStartupScript (this.GetType (), "Prompt", strScript);
}
}
} |
|