Main Menu Click Event Disable

Posted by Vikie4u under ASP.NET on 10/21/2008 | Views : 5983 | Status : [Member] | Replies : 3
Hi Members,

I have a problem related the main menu click event .There are main menu tabs in my application,for each main menu items there are sub menu items.Now ,what I want is that there should not be any click event for the main menu item,but the click event for the sub items should be there.

Thanks,
Vikram




Responses

Posted by: Raja on: 10/21/2008 [Member] Starter

Up
0
Down
Do not speicify url value for your main items and it should work.



Regards,
Raja, USA

Vikie4u, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vikie4u on: 10/21/2008 [Member] Starter

Up
0
Down
Hi Raja,

Thanks for your reply,but when I'm not specifying the URL than on clicking the control is going to blank page.I want to stop the page refresh thing when clicked on main menu.


Thanks,
VIkram

Vikie4u, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 10/21/2008 [Member] Starter

Up
0
Down
I am not sure why it is going to blank page in your case. See below example. In this case it is remaining on the same page.

Create a web.sitemap file and copy paste following code.
<?xml version="1.0" encoding="utf-8" ?>

<siteMap>
<siteMapNode url="" title="Home" description="Go to home page">
<siteMapNode url="~/addmembers.aspx" title="Add Member" description="Add members">
<siteMapNode url="~/addusers.aspx" title="Add Users" description="Add Users" />
</siteMapNode>
</siteMapNode>
</siteMap>


Create a test.aspx page and copy paste following code.

<asp:Menu ID="menu1" runat="server" DataSourceID="Sm1" 

onmenuitemclick="menu1_MenuItemClick"></asp:Menu>
<asp:SiteMapDataSource ID="Sm1" runat="server" />


In this case clicking on Home link is not going to any blank page but remaining on the same page. See if you have specified some other properties in the Menu control.

Thanks

Regards,
Raja, USA

Vikie4u, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response