Combo Control
This is a control which will help to generate Tabs , Menus, Slider bars, and Tree views. Just in time dynamically from XML.
Background
Using the code
The user control has four public properties:
<%@ Register TagPrefix="CONTROL" Namespace="Controls" Assembly="FOURINONE"%>
// for tab
<CONTROL:FourinOne runat="server" PageTitle="Congress Type" Controltype="tab"
MainMenuSelected="2" SubMenuSelected="1" />
// for tree
<CONTROL:FourinOne runat="server" Controltype="tree" />
// for panel bar
<CONTROL:FourinOne runat="server" Controltype="panel" />
// for menu - horizontal
<CONTROL:FourinOne runat="server" Controltype="menu" Display="h" />
// for menu - vertical
<CONTROL:FourinOne runat="server" Controltype="menu" Display="v" />
For generating the menu, tree, panel, tab dynamically the xml should be of the form
<Menu>
<MainMenu Label="Registration" BaseURL="SearchCongress.aspx" MenuID="8"
MainSecurity="AM" MenuSequence="1" ImageUrl="xp_documents.gif">
<SubMenu Label="Search" URL="SearchCongress.aspx" MenuID="8"
Security="AM" SubMenuID="9" SubMenuSequence="1" ImageUrl="xp_documents.gif"/>
<SubMenu Label="Add Company" URL="CompanyDetails.aspx" MenuID="8"
Security="A" SubMenuID="6" SubMenuSequence="4" ImageUrl="xp_documents.gif"/>
<SubMenu Label="New Order" URL="NewOrder.aspx" MenuID="8" Security="AM"
SubMenuID="7" SubMenuSequence="5" ImageUrl="xp_documents.gif"/>
</MainMenu>
<MainMenu Label="Maintenance" BaseURL="Congress.aspx" MenuID="6"
MainSecurity="A" MenuSequence="4" ImageUrl="xp_documents.gif">
<SubMenu Label="Congress Type" URL="Congress.aspx" MenuID="6" Security="A"
SubMenuID="1" SubMenuSequence="1" ImageUrl="xp_documents.gif"/>
<SubMenu Label="Event Type" URL="EventType.aspx" MenuID="6" Security="A"
SubMenuID="2" SubMenuSequence="2" ImageUrl="xp_documents.gif"/>
<SubMenu Label="Sales Type" URL="SalesType.aspx" MenuID="6" Security="A"
SubMenuID="3" SubMenuSequence="3" ImageUrl="xp_documents.gif"/>
<SubMenu Label="Venue" URL="CongressVenue.aspx" MenuID="6" Security="A"
SubMenuID="4" SubMenuSequence="4" ImageUrl="xp_documents.gif"/>
<SubMenu Label="Office" URL="Office.aspx" MenuID="6" Security="A"
SubMenuID="6" SubMenuSequence="6" ImageUrl="xp_documents.gif"/>
<SubMenu Label="Sales Person" URL="SalesPerson.aspx" MenuID="6" Security="A"
SubMenuID="7" SubMenuSequence="7" ImageUrl="xp_documents.gif"/>
<SubMenu Label="Tax Rate" URL="TaxRate.aspx" MenuID="6" Security="A"
SubMenuID="8" SubMenuSequence="8" ImageUrl="xp_documents.gif"/>
<SubMenu Label="User" URL="User.aspx" Security="A" MenuID="6"
SubMenuID="9" SubMenuSequence="9" ImageUrl="xp_documents.gif"/>
<SubMenu Label="Option Type" MenuID="6" URL="PriceOption.aspx" Security="A"
SubMenuID="10" SubMenuSequence="10" ImageUrl="xp_documents.gif"/>
</MainMenu>
</Menu>
private bool isAuthorised(string sSecString, string sSecType){
return(sSecString.IndexOf(sSecType)>=0);
}
The menu can be configured using web.config.
<add key="MenuXMLPath" value="/helper/" />
<add key="MainMenuFontColor" value="#ffffff" />
<add key="MainMenuShadowColor" value="#999999" />
<add key="MainMenubGColor" value="#000088" />
<add key="MainMenuMouseoverColor" value="#000088" />
<add key="SubmenuBgColor" value="#cfd3d8" />
<add key="SubmenuMouseoverColor" value="#ffffff" />
<add key="SubmenuBorderColor" value="#0000cc" />
<add key="SubmenuFontColor" value="#000000" />
<add key="SubmenuMouseOverFontColor" value="#000000" />
<add key="SubmenuShadowColor" value="#666666" />
No comments:
Post a Comment