Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help, event not triggered

Reply
Thread Tools

Help, event not triggered

 
 
Jeff
Guest
Posts: n/a
 
      07-18-2006
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:
<aspanel 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>
</aspanel>


 
Reply With Quote
 
 
 
 
Jeff
Guest
Posts: n/a
 
      07-18-2006
Setting the MenuItem DataBindings solved this problem


"Jeff" <(E-Mail Removed)> wrote in message
news:eggA$(E-Mail Removed)...
> 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:
> <aspanel 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>
> </aspanel>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Usercontrol; Event not triggered Sjaakie ASP .Net 1 08-06-2006 09:49 PM
page load event not triggered samuelberthelot@googlemail.com ASP .Net 4 03-06-2006 05:23 PM
click event not triggered samuelberthelot@googlemail.com ASP .Net 2 02-28-2006 05:14 PM
DataGrid SortCommand event not triggered John Sturgeon ASP .Net 2 12-02-2003 07:14 PM
TextChanged event is not triggered when the text is changed automatically Steve Pan ASP .Net 1 11-06-2003 01:55 AM



Advertisments