Kallumasaurus
Kallumasaurus

Reputation: 271

Message Errors in ASP.Net

I know & always use the:

Try
Catch Ex As Exception("Error!")
End Try 

I am just wondering, is there any other way in this simple format that is just as effective in making a message box error?

Bear in mind I use this in my VB.NET code behind my Asp.Net , so C# etc is out the question.

Is this the only solution for VB?

Upvotes: 0

Views: 136

Answers (2)

Sai Avinash
Sai Avinash

Reputation: 4753

If you do want to any other additional things apart from just showing 'Error!' message.

You can further show the message description to the user by using Ex.Message or you can also show stack trace which has caused the error

Hope this helps you..

Upvotes: 1

gayan1991
gayan1991

Reputation: 795

ScriptManager.RegisterClientScriptBlock(btnsave, btnsave.GetType(), "message", "alert('" + ex.Message + "');", True)

this code will be executed as client script..!

Upvotes: 0

Related Questions