Why we should not use throw in application

Posted by Jeena under C# on 6/13/2013 | Points: 10 | Views : 696 | Status : [Member] | Replies : 0

I have a function in Controller(return type=void) which checks whether the entry in database is exist or not,if not I wanted to show the user a message like 'Entry is already exist'.But my ajax call is always returning OnSuccess as it couldnt find out any error.

Most of the forums saying it can be done by throwing the exception,but am not sure its a good method.What is the best approach I can use in this case .My requiremnt is I wanted to show my customer a custom message like 'entry alreay exist'.

Its good to use throw exception in this case?Or any other technique we can use to show the user a custom message?If we use
throw what will be the disadvantage.



(No response found.)

Login to post response