protected void SaveButton_Click(object sender, EventArgs e)
{
try
{
if (CheckForDuplicates())
{
//proceed normally
}
}
}
private bool CheckForDuplicates()
{
//check database
if (/*there are duplicates*/)
{
string message = "A duplicate name exists. Would you like to continue?";
string scriptString = "<script language='javascript'
type='text/javascript'>" + "return confirm('" + message + "');</script>";
ScriptManager.RegisterStartupScript(this, this.GetType(),
"script", scriptString, false);
//here i would like to return their confirmation
}
}
}
return true;
}
Translate
Thursday, 15 November 2012
CheckForDuplicates confirmation message
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment