Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
special case of use in web improvement?
sireesha siri
Jan 23 2018 8:25 AM
152
Reply
Hi,
I end up utilizing exemption in web improvement notwithstanding for conditions that are not by any stretch of the imagination mistakes, not to mention uncommon ones - just rationale choices, approvals...
in a website page, I frequently compose code like so:
try
{
int
id;
if
(!
int
.TryParse(txtID.Text, out id))
throw
new
Exception(
"ID must be an integer"
);
if
(IdAlreadyExists(id))
throw
new
Exception(
"ID already exists in database"
);
//and so on...
}
catch
(Exception ex)
{
SetErrorLine(ex.Message);
}
I was thinking about whether this is extremely the right method for utilizing special cases and authorizing Business Logic in web advancement.
P.S.: I am utilizing asp.net, and clearly I could utilize ASP.NET validators for some of these and furthermore isolate UI from rationale, yet I'm endeavoring to make a point of the general thought.
Thanks and Regards
sireesha.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How we Extract Image from pdf
Detect Ip and device viewer