I have a small website that has a single MasterPage and a handful of Content Pages. My MP contains an asp:Menu item where all the subsequent CP's are called from. My problem is, when I issue a Response.Redirect command, it will first throw an exception ("Unable to evaluate expression") but then return to where it issued the statement and load the page. I don't understand MP's very well. Here is my code below:
The Red highlighted line of code executes and then immediately takes the Catch route but doesn't display the error (lblMessage is a Label control on my MP). I only see the error while running thru the debugger.Code:Private Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick Try Select Case e.Item.Value Case "mnuCustomerMaintenance" Response.Redirect("~/Customer/Customer.aspx") Case "mnuViewCustomers" Session("disableButtons") = True Response.Redirect("~/Customer/Customer.aspx") Case "mnuLogin" Response.Redirect("~/Admin/SysLogin.aspx") End Select Catch ex As Exception lblMessage.Text = dbIO.DisplayError("Menu1_MenuItemClick()", "SiteMP", ex.Message) End Try End Sub
Please help!




Reply With Quote