|
-
Apr 9th, 2011, 11:27 AM
#1
Thread Starter
PowerPoster
Issues w/Master Pages?
I'm pretty new to web programming and I've been told that if this is what I want to do....I should use MP's and not Frames/IFrames. So, I'm trying to use them and finding it a little difficult. My understanding is that a MP can contain controls that appear whenever any other Content Pages are in view. So, I have added an asp:Menu control to my MP. Each menu item references a CP. What's weird is, when I click a menuItem, I retrieve a CP using the "Response.Redirect" command. However, even though it will load my CP, it will throw an unseen exception - "Unable to evaluate expression". Why is it doing that and even moreso, what's the correct way to call a CP?
Thanks,
-
Apr 9th, 2011, 01:10 PM
#2
Re: Issues w/Master Pages?
Hello,
Can you show the code that you are using?
Bottom line is, you simply call the Content Page. 
Let's say you have Default.aspx, Login.aspx and Register.aspx. Each of these content pages references the Master Page (which you never actually call) and in doing that, each of them will show the Menu with is contained within the Master Pages markup.
From there, you Menu items simply need to do a Response.Redirect to Default.aspx, Login.aspx and Register.aspx.
Or, better still, don't do that code yourself. Create a web.sitemap file, and add a SiteMapDataSource to your page, and point the Menu Control at the SiteMapDataSource and it will handle it all for you.
Gary
-
Apr 9th, 2011, 01:47 PM
#3
Thread Starter
PowerPoster
Re: Issues w/Master Pages?
Gary,
Here is the code that is in my MP. This is what controls calling my CP's.
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 "mnuLookupTable"
Response.Redirect("~/Admin/LookUp.aspx")
Case "mnuEmployees"
Response.Redirect("~/Employee/Employee.aspx")
Case "mnuSystemSettings"
Case "mnuPrinterSetup"
Case "mnuPrint"
Case "mnuCustomerMaintenance"
Case "mnuViewCustomers"
Case "mnuInventoryMaintenance"
Response.Redirect("~/Inventory/Inventory.aspx")
Case "mnuViewInventory"
Response.Redirect("~/Inventory/Inventory.aspx")
Case "mnuReceiveInventory"
Case "mnuAdjustLevels"
Case "mnuVendorMaintenance"
Response.Redirect("~/Vendors/Vendors.aspx")
Case "mnuViewVendors"
Response.Redirect("~/Vendors/Vendors.aspx")
Case "mnuInvoiceMaintenance"
Response.Redirect("~/Invoicing/InvoiceMaintenance.aspx")
Case "mnuViewInvoices"
Case "mnuChangePassword"
Response.Redirect("~/Admin/ResetPassword.aspx")
Case "mnuPrintInvoices"
Case "mnuReportCustomerMasterListing"
Case "mnuInventoryMasterListing"
Case "mnuReportInventoryOutofStock"
Case "mnuReportInventoryPriceList"
Case "mnuReportVendorMasterListing"
Case "mnuReportINvoicingHistoryAging"
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
-
Apr 19th, 2011, 02:01 AM
#4
Re: Issues w/Master Pages?
Hey,
Ah, ok, you are wrapped in a Try/Catch.
Try using the second parameter of the Response.Redirect method:
http://msdn.microsoft.com/en-us/library/a8wa7sdt.aspx
Gary
-
Apr 19th, 2011, 02:20 AM
#5
Re: Issues w/Master Pages?
Which line throws that error?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|