Re: Urgent User Control

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



> Kevin,
> Can you answer my question? Or are you still not clear about the
> question???

I DID answer it:

>>>> Here's how exceptions work. When a function calls another function that
>>>> calls another function that raises an exception, the final function
>>>> raises the exception. If the exception is not handled by that function,
>>>> it will cause the exception to "bubble up" to the function that called
>>>> the function that raised the exception. This will happen until either
>>>> (1) the exception is handled at some point in the chain, or (2) the
>>>> application thread is aborted due to an unhandled exception.
>>>>
>>>> Knowing this, of course, your solution is obvious.

If you want me to spell it out for you, you put a try/catch in whatever
function in the chain that you want to handle the exception. Functions are
called by other functions.

For example, low-level classes generally throw exceptions rather than
catching or handling them. Higher level applications use these classes, and
functions that use them should handle any exceptions thrown by functions in
the low-level classes. Since I don't know the hierarchy in your code, or how
it is designed, I can't tell you specifically in what function to handle the
exception in, or specifically how to handle it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Prince Mathew" <princematthewkoshy@xxxxxxxxxxx> wrote in message
news:eUZYXH6OFHA.1176@xxxxxxxxxxxxxxxxxxxxxxx
> Kevin,
> Can you answer my question? Or are you still not clear about the
> question???
>
> "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:Oy6qqA6OFHA.2704@xxxxxxxxxxxxxxxxxxxxxxx
>>> I know how exception handling works. But my question is how will you
>>> catch an exception thrown from the User Control.
>>
>> Classes don't throw exceptions. Functions do.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> What You Seek Is What You Get.
>>
>> "Prince Mathew" <princematthewkoshy@xxxxxxxxxxx> wrote in message
>> news:u3WBvk5OFHA.688@xxxxxxxxxxxxxxxxxxxxxxx
>>> Kevin,
>>>
>>> I know how exception handling works. But my question is how will you
>>> catch an exception thrown from the User Control. Say you are throwing an
>>> exception from the Page_Load of the user control.Where will you put the
>>> try catch in the container page.
>>>
>>> Thanks
>>> Prince
>>>
>>> "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>>> news:u95wug5OFHA.2252@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Here's how exceptions work. When a function calls another function that
>>>> calls another function that raises an exception, the final function
>>>> raises the exception. If the exception is not handled by that function,
>>>> it will cause the exception to "bubble up" to the function that called
>>>> the function that raised the exception. This will happen until either
>>>> (1) the exception is handled at some point in the chain, or (2) the
>>>> application thread is aborted due to an unhandled exception.
>>>>
>>>> Knowing this, of course, your solution is obvious.
>>>>
>>>> --
>>>> HTH,
>>>>
>>>> Kevin Spencer
>>>> Microsoft MVP
>>>> .Net Developer
>>>> What You Seek Is What You Get.
>>>>
>>>> "Prince Mathew" <princematthewkoshy@xxxxxxxxxxx> wrote in message
>>>> news:O9o9Oc5OFHA.3512@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> Hi All,
>>>>>
>>>>>
>>>>>
>>>>> I have a requirement. I am throwing an exception from my user control
>>>>> I want to catch this in my container page. Is this possible?
>>>>>
>>>>> I don't want any event to be raised.
>>>>>
>>>>> PLEASE HELP ME.
>>>>>
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> Prince
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages