excell38660
New Member
I'm using ASP.NET to implement a site and need some help giving the user some feedback when submitting a form.I use a detailsview to have the user insert the data needed but when I want to give the user some feedback when the insert succeeds or fails. So if the insert is successfull I want to run the JS function to show a success notification, and otherwise an error notification.I tried using \[code\]OnInserted="areaInsertHandler"\[/code\]On the SQL data source and then check for exceptions using:\[code\]protected void areaInsertHandler(Object sender, SqlDataSourceStatusEventArgs e) { if (e.Exception != null) { // There was an error in submitting, show the error notification ClientScript.RegisterClientScriptBlock(GetType(), "DialogHandler", "showError();", true); e.ExceptionHandled = true; } else { // Show success ClientScript.RegisterClientScriptBlock(GetType(), "DialogHandler", "showSuccess();", true); } }\[/code\]But when I submit neither of the functions seem to fire. Using a debugger the JS functions are not even entered, so it seems that they aren't called.The detailsview is inside a updatepanel if that makes any difference.Any feedback or other suggestions on how to approach the problem would be greatly appreciated.Kind regards