Showing posts with label exception. Show all posts
Showing posts with label exception. Show all posts

Saturday, March 24, 2012

UpdatePanel and Exception

When throw out an Expcetion inside UpdatePanel, the error message will be display in a message box window.
How to customize the style of message in this message box? For instance, when I use \n, \r, <br> to try to seperat the message into mutiple line, it doesn't work. How to implelent it?

If throw out an exception not inside UpdatePanel, the error message will display in the page directly.
So anyway to decide the way of dispalying errormessage?

You need to specify an ErrorTemplate in your ScriptManager. There is also a server event handler that you can hook into.

See documentation here:
http://atlas.asp.net/docs/Server/Microsoft.Web.UI/ScriptManager/P_ErrorTemplate.aspx

HTH,

Perry

Wednesday, March 21, 2012

UpdatePanel and form validation on the server side

Ok here is what I am experiencing. I have an UpdatePanel on my page. I am performing form validation on the server side by throwing an exception if the validation fails. This is working fine until I set custom errors to "RemoteOnly" in the web.config file. This makes sense since I am throwing an exception.

So the big question is how can I perform server validation on form fields with out throwing an exception?

Thanks!!

While we work closely with the ASP.NET AJAX team when developing the Toolkit, they're the real experts on general ASP.NET AJAX issues. Your problem doesn't seem to be directly related to the Toolkit, so we'd appreciate if you considered posting to one of theother newsgroups such asAJAX Discussion and Suggestions. Your post will be more helpful to others looking for similar advice if it's in the right place. Thank you!