Exceptions from DLL in ASPX page

S

Steve

Hi... new to ASP.NET... I am creating a DLL using VB.NET which my ASPX
page will be calling. I have a class in the DLL (MyClass) which has a
property (MyProperty). If the value assigned to MyProperty is set by
my ASPX page to be out of bounds, I want to raise an exception that
gets captured in the ASPX page, causing it to fail. This is working
OK. However, when the page fails, in the browser the SOURCE ERROR part
of the error page is showing the code within the DLL where the
exception is thrown. I want it to show the line in the ASPX page that
is in error. Any ideas why this is happening? TIA... Steve
 
S

Steve

Good info that I didn't know about. However, this seems to deal with a
setting within the web app. I want something in the DLL that will
cause error messages from exceptions to be raised in the ASPX page,
showing the line within the ASPX that is in error. Basically this DLL
will be a commercially marketed component and I don't want the code
inside the DLL to ever be seen by the user (which is currently
happening when the DLL code is shown in the SOURCE ERROR section of the
error page)
 
K

Kevin Spencer

Try
Handling the Error
Catch Ex As Exception
Do whatever you want to with it
End Try

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
B

Brock Allen

Right, so as kevin said don't let exceptions propagate outside your API calls
is one way to solve that. But if you need to report back errors via exceptions
(since that is the model) then it's not up to your component if the dev shows
it in the page or not.
 
K

Kevin Spencer

But if you need to report back errors via exceptions (since that is the
model) then it's not up to your component if the dev shows it in the page
or not.

I suppose I wasn't being too clear. I didn't mean that the DLL classes
should handle the errors. I meant that the client (ASP.Net) application
should handle them, for the most part. I do use some structured exception
handling in my business classes, but usually pass the exceptions up the line
to be dealt with by the client.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top