[thelist] [ASP.NET] best practice error handling

Ken Schaefer ken at adOpenStatic.com
Wed Apr 14 06:11:40 CDT 2004

I suppose there are a few ways you can do this.

For example, if you are dynamically adding the controls to the page, you
could choose to add a repeater, or a label, depending on what is returned
(dataset or string). Otherwise, if you have some kind of errors collection,
you could have a control to display those.

There's an ASP.Net architecture list here:
(the list signup UI leaves a lot to be desired, but the people on the list
are good).


From: "Les Lytollis" <leslytollis at dimensions-corporatewear.co.uk>
Subject: [thelist] [ASP.NET] best practice error handling

I have entered the world of n-tier, oo, e-commerce design in ASP.NET  /
C# and I am getting a little bogged down in passing back errors from the
data layer to the presentation layer. I would appreciate any input.

As an example.

A data layer method  GetProductSetID returns an ID string to a business
The business method GetProdutSet uses the result to return a DataSet to
the presentation layer.
The presentation layer ProductSet.aspx.cs populates a DataRepeater with
the returned DataSet.
If, however, datalayer.GetProductSetID has an empty result set, it
returns the string "No records match your search".
How do I get this error string from within businesslayer.GetPSDetails
(which should return a DataSet) to, say a label on the calling page?

Les Lytollis
Web Developer

More information about the thelist mailing list