473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Help, event not triggered

Hey

asp.net 2.0

I'm having a menu on my webpage. In this menu I've placed some code at the
ItemClick event:
protected void mnuHeader_MenuItemClick(object sender, MenuEventArgs e)
{
switch (e.Item.Value)
{
case "test a":
SiteMapDataSource dataSource = (SiteMapDataSource)
lvSidebar.FindControl("SiteMapDataSource1");
return;
}
}
I set a breakpoint on this line "switch (e.Item.Value)", but while running
the applcation the brakpoint isn't triggered. So I wonder what I'm doing
wrong here?

Just in case, here is my menu:
<asp:Panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100;
left: 10px; position: absolute; top: 91px" Width="918px">
<asp:LoginView ID="lvMenu" runat="server">
<AnonymousTemplate>
&nbsp;
</AnonymousTemplate>
<LoggedInTemplate>
<asp:Menu ID="mnuHeader" runat="server" BackColor="#F7F6F3"
DataSourceID="SiteMapDataSource1"
DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em"
ForeColor="#7C6F57"
MaximumDynamicDisplayLevels="0" Orientation="Horizontal"
StaticDisplayLevels="2"
StaticSubMenuIndent="10px" Style="z-index: 100; left: 0px;
position: absolute;
top: 0px" OnMenuItemClick="mnuHeader_MenuItemClick">
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
/>
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<StaticSelectedStyle BackColor="#5D7B9D" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<DynamicMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
SiteMapProvider="LoggedIn" />
</LoggedInTemplate>
</asp:LoginView>
</asp:Panel>
Jul 18 '06 #1
1 962
Setting the MenuItem DataBindings solved this problem
"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:eg**************@TK2MSFTNGP03.phx.gbl...
Hey

asp.net 2.0

I'm having a menu on my webpage. In this menu I've placed some code at the
ItemClick event:
protected void mnuHeader_MenuItemClick(object sender, MenuEventArgs e)
{
switch (e.Item.Value)
{
case "test a":
SiteMapDataSource dataSource = (SiteMapDataSource)
lvSidebar.FindControl("SiteMapDataSource1");
return;
}
}
I set a breakpoint on this line "switch (e.Item.Value)", but while running
the applcation the brakpoint isn't triggered. So I wonder what I'm doing
wrong here?

Just in case, here is my menu:
<asp:Panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100;
left: 10px; position: absolute; top: 91px" Width="918px">
<asp:LoginView ID="lvMenu" runat="server">
<AnonymousTemplate>
&nbsp;
</AnonymousTemplate>
<LoggedInTemplate>
<asp:Menu ID="mnuHeader" runat="server" BackColor="#F7F6F3"
DataSourceID="SiteMapDataSource1"
DynamicHorizontalOffset="2" Font-Names="Verdana"
Font-Size="0.8em" ForeColor="#7C6F57"
MaximumDynamicDisplayLevels="0" Orientation="Horizontal"
StaticDisplayLevels="2"
StaticSubMenuIndent="10px" Style="z-index: 100; left: 0px;
position: absolute;
top: 0px" OnMenuItemClick="mnuHeader_MenuItemClick">
<StaticMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<StaticSelectedStyle BackColor="#5D7B9D" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<DynamicMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
SiteMapProvider="LoggedIn" />
</LoggedInTemplate>
</asp:LoginView>
</asp:Panel>


Jul 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: coolsti | last post by:
Can someone help me enhance this code snippet which works only for IE so that it will also work for Firefox? I have been trying all sorts of things and have gotten to where I can capture the...
0
by: Sam Sungshik Kong | last post by:
Hello! If I understand correctly, MouseMove event is triggered when the mouse moves (ie when point changes). I, however, found out that it's triggered even if the mouse is not moving. What I...
1
by: no spam | last post by:
Hi, I want to encapsulate code to change BUTTON elements on a webpage in one place in an HTC file. Here is the code in my HTC FIle: <PUBLIC:COMPONENT> <PUBLIC:ATTACH EVENT="onmouseup" ...
10
by: brooksr | last post by:
I know VB5/VBA very well but have not used VB to create web pages but need to do so. Can someone explain the purposes and differences between VBScript and VB.NET to create web pages? Also...
4
by: slikrik98 | last post by:
Greetings, I have an application that subscribes to an intensive data feed, constantly receiving messages, and then routes those messages to various "listeners." My first attempt was to just...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.