Hi All,
I am using Menu control in asp.net. I am creating Menu control using xml databinding.
Here is the xml file;
<?xml version="1.0" encoding="utf-8" ?>
<Items Text="">
<Item Text="" ImgPath="./../images/home.gif" Url="" Value="Home" />
<Item Text="" ImgPath="" Url="" Value="Time Entry" >
<Item Text="" Value="Our Clients" ImgPath="./../images/oc.gif" Url="~/OurClients.aspx" />
</Item>
<Item Text="" ImgPath="" Value="Admin" Url="">
<Item Text="" Value="About Us" ImgPath="./../images/AboutUs.gif" Url ="~/AboutUs.aspx" />
</Item>
</Items>
For creating menu, in .aspx page, I am using;
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" DisappearAfter="10"
Width="300px" DataSourceID="XmlDataSource1" StaticEnableDefaultPopOutImage="False" OnMenuItemClick="Menu1_MenuItemClick">
<StaticMenuItemStyle CssClass="MenuItem" />
<DynamicHoverStyle CssClass="SubMenuItemHover" />
<DynamicMenuItemStyle CssClass="SubMenuItem" />
<StaticHoverStyle CssClass="MenuItemHover" />
<DataBindings>
<asp:MenuItemBinding DataMember="Item" NavigateUrlField="Url" TextField="Text" ImageUrlField="ImgPath" ValueField="Value" />
</DataBindings>
</asp:Menu>
Now, I am trying to get MenuItem from this Menu control. For that, on page load, I am using ;
MenuItem mn = Menu1.FindItem("Home");
But, it is returning null.
Please help me to get the solution.
Thanks in Advance.