I have created a menu control in asp.net and put it on the master page. This menu is the property activity in control, One or another item is actively visible from the menu when it modifies.
To control the active page from the child page, I have created a control that updates the IMenuContainer interface menu on the active item of the control.
Public class MenuActiveItem: Control {Public ActiveItemEnum ActiveItem {get} var masterpage = Page. Mister as IMenuContainer; If (MasterPage == blank) Back to ActiveItemEnum.None; Return Masterpage. ActiveTime; } Set {var masterpage = Page. Mister as IMenuContainer; If (masterpage == empty) return; MasterPage.ActiveItem = Value; }}}
Everything works perfectly and I really enjoy this solution, but I was wondering if I knew that I would rather have one It just makes sense to make a custom command with the feature itself.
Anyone have to do this?
You can change it to a custom property of your page, which you can set in page directive. Are there.
Create a base class for your page, and then change your page directions like this:
<% @ Page Language = "C #" MasterPageFile = "~ / Appmaster." CodeFileBaseClass = "BasePage" ActiveItem = "myActiveItem" AutoEventWireup = "true" codefile = "Page1.aspx.cs" Inherits = "Page 1"%>
You may have to change the property to a string, and you may have to make a conversion in enum. But otherwise your code can remain the same, and it should not be in control.
Comments
Post a Comment