How to show Catch block exceptions in Validation summary

290 Views Asked by At

I have a try and catch block for sending multiple emails. Everytime a exception in email address occurs then in Catch block it is set as text to multiline textbox. But I am having problem showing large data.

the current code is:

catch(Exception ex)
{
   txtexception.Text = txtexception.Text + "\n" + ex.Message;                   
}

Note: I am testing it on data having 5 incorrect email addresses. So there are 5 exception messages to display.

So, I am now thinking of displaying error messages in validation summary control. Is there any way to do that from code behind(button click).

Thank you for all your help!

0

There are 0 best solutions below