public void showmessage(string strMessage)
{
//String strScript = "" ;
//if(! ClientScript.IsStartupScriptRegistered("clientScript"))
// ClientScript.RegisterClientScriptBlock(this.GetType(), "clientScript", strScript);
Label lbl = new Label();
lbl.Text = "";
// add the label to the page to display the alertbox
Page.Controls.Add(lbl);
}
protected void gvUsers_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{
if (e.Exception != null)
{
string[] s= e.Exception.StackTrace.ToString().Split(new char[]{'\n'});
string errormessage = String.Format("Exception while Updating: {0}
{1}", e.Exception.Message, s[1]);
e.ExceptionHandled = true;
errormessage = "Violation of Primay key occured";
showmessage(errormessage);
}
}
No comments:
Post a Comment