Re: What if the Query String is empty?
- From: "George" <noemail@xxxxxxxxxxx>
- Date: Mon, 3 Nov 2008 20:56:19 -0500
"exceptions are handled" and "exceptions are not happening" 2 different things...
I did not say that user needs to get ASP.NET error screen with bunch of information if something is not integer.
But if user decided to play with QueryString by hand and put into ProductId his name instead of number he deserves to be redirected to the default.aspx how I do it in case of exception that is caught in Application_OnError
So it's perfectly OK to assume that ProductId is a number (if it's in database) and do a conversion without tipping-toeing around.
George.
"Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx> wrote in message news:ewxfiohPJHA.4372@xxxxxxxxxxxxxxxxxxxxxxx
"George" <noemail@xxxxxxxxxxx> wrote in message news:eCm0dihPJHA.3560@xxxxxxxxxxxxxxxxxxxxxxx
Are we back to this????
What if the sun will not come up tomorrow.....
Any programming is based on assumptions.... And it's good to have those assumptions.
Utter rubbish! Utter, utter garbage!
Robust programming (look it up on Google) is based on doing whatever you can to make sure that exceptions are handled.
Trying to instantiate an integer from something which cannot be converted into an integer will cause an exception.
Trapping for that eventualilty will not...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
.
- Follow-Ups:
- Re: What if the Query String is empty?
- From: Juan T. Llibre
- Re: What if the Query String is empty?
- References:
- What if the Query String is empty?
- From: MU
- Re: What if the Query String is empty?
- From: Cowboy \(Gregory A. Beamer\)
- Re: What if the Query String is empty?
- From: Mark Rae [MVP]
- Re: What if the Query String is empty?
- From: George
- Re: What if the Query String is empty?
- From: Mark Rae [MVP]
- What if the Query String is empty?
- Prev by Date: RE: Attach to Process
- Next by Date: the mvp Code IhttpModel problem--Compression support in ASP.NET 2.0
- Previous by thread: Re: What if the Query String is empty?
- Next by thread: Re: What if the Query String is empty?
- Index(es):
Relevant Pages
|