Hi,
I want to show the menu i have on my master page on another page, but since it might change on the Master page eventually, I want to ensure that other places that reference it also change for consistency.
I've tried this code:
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim masterPageMenu As Control = Page.Master.FindControl("Menus")
panel1.Controls.Add(masterPageMenu)
End Sub
End Class
However I am getting an error
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
I have used FindControl with MasterPages, but it was a while back. And it was only to Show/Hide content, not actually display what it contains, so this is a different scenario. Thanks ...
Go to the complete details ...