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

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -