c# - Custom error handling ASP.NET -


I want to use custom exception handling, for example

instead of using (exception Ex) I want

Is it possible to design such custom exception handling in ASP.NET webforms?

Yes, but what you need to do is first create your own custom exception exception from the base class Need to get your exception. An example is:

Then you need to increase this exception in your code appropriately Have Private: Zero login (string username, string password) {if (username! = Dbu name & password! = Db password) login details are incorrect ");} // Other Login ...} Private Zero Button (Object Sender, EventArgs E) {Log In (txtUsername.Text, txtPassword.Text);} Catch (LoginFileExchange Pre) {// Handle Exception}}


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -