CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 10/12/2007 2:41:57 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 64 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
MDCragg
Asp.Net User
Menu click event handling problem on master page...10/12/2007 2:41:57 AM

0/0

The following script and menu are both placed in my master page.  When I click on a menu item I am taken to the page I expect just fine.  However, I also want to do some processing when a menu item is clicked (in addition to going to the new page).  Thus I am trying to call the Menu_Posts_MenuItemClick procedure.  But nothing happens when I click on a menu item (other than navigating to the new page...which does work).  For testing I tried to do something simple like updating a label but even that doesn't work.

Does anybody have any ideas as to what I am missing or doing wrong.

<script runat="server">

 

    Sub Menu_Posts_MenuItemClick(ByVal sender As Object, ByVal e As MenuEventArgs) Handles Menu_Posts.MenuItemClick

 

        Dim Index As Integer = Int32.Parse(e.Item.Value)

        Dim label1 As Label = CType(Me.FindControl("label1"), Label)

        label1.Text = 1 'Index
 

    End Sub


</script>

 

<asp:Menu

ID="Menu_Posts"

runat="server"

DataSourceID="PCSiteMapDataSource"

Orientation="Horizontal"

OnMenuItemClick="Menu_Posts_MenuItemClick"

style="position: relative; top: -18px"

StaticEnableDefaultPopOutImage="False">


    <StaticMenuItemStyle
 
    Font-Names="Arial"

    Font-Size="12px"

    ForeColor="White" />


    <DynamicMenuItemStyle

    Font-Names="Arial"

    Font-Size="12px"

    ForeColor="Yellow" />

   
    <StaticItemTemplate>

        <%# Eval("Text") %>

    </StaticItemTemplate>


</asp:Menu>

Thanks in advance...MDCragg

s_kushal
Asp.Net User
Re: Menu click event handling problem on master page...10/12/2007 5:35:40 AM

0/0

1. Try debugging and see if the control goes to the click event or not

2. if it does try seeing how postBack is handled if the page goes to load after the click or what ??


No question is so difficult to answer as that to which the answer is obvious.
Johnson2007
Asp.Net User
Re: Menu click event handling problem on master page...10/15/2007 5:44:55 AM

0/0

 If you bind the NavigateUrl of the Menu item, it will not raise the itemclick event, becuase it direcitly redirect to another new page. To raise the Itemclick event, do not bind the NavigateUrl property of Menu item.


Johnson
Amanda Wang - M
Asp.Net User
Re: Menu click event handling problem on master page...10/15/2007 5:58:53 AM

0/0

Hi MDCragg,

Base on your description, your menu's datasource is sitemapdatasource, when you click on the menuitem, it did not fire the menuitem click event, right?

In fact, If the menuitem's navigateURL is not empty, when you click on it, it will redirect to page that the its naviageteURL is on without postback, this happened in the client, so the menu item click event will not be fired.

But if you do not use the sitemapdatasourse for the menuite, and add the menu items in the aspx file, do not set the NavigateURL for the menuitem, the click event will be fired.

 

Hope it helps.

 

 


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Mastering Web Development with Microsoft Visual Studio 2005 Authors: John Paul Mueller, Pages: 822, Published: 2005
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
Learning ASP.NET 3.5 Authors: Jesse Liberty, Dan Hurwitz, Brian MacDonald, Pages: 576, Published: 2008
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit: visual web developer 2005 express edition starter kit Authors: David Sussman, Alex Homer, Pages: 312, Published: 2005
Microsoft Visual C# .NET 2003 Developer's Cookbook: Developer's Cookbook Authors: Mark Schmidt, Simon Robinson, Pages: 787, Published: 2003
Programming Visual Basic 2005 Authors: Jesse Liberty, Pages: 548, Published: 2005
Mastering InDesign CS3 for Print Design and Production: for print design and production Authors: Pariah S. Burke, Pages: 492, Published: 2007
The Software Catalog: Microcomputers, Winter, 1990 Authors: Menu International Software, Pages: 0, Published: 1990
Microsoft ADO.NET Step by Step: step by step Authors: Rebecca Riordan, Pages: 512, Published: 2001

Web:
Menu click event handling problem on master page... - ASP.NET Forums Menu click event handling problem on master page... Last post 10-15-2007 1:58 AM by Amanda Wang - MSFT. 3 replies. Sort Posts: ...
Problem Using MasterPage and Update Panel - ASP.NET Forums Unfortunately, i must click the menu twice to make the content of update panel ... The Page_Load event handler of content page is prior to that of master ...
Capture Master Page Events in Content Pages - ASP.NET 2.0 - Steve ... In the Page Load of the content page, we simply add an event handler to the public event you ... Reacts to Master Page menu click event /// ...
Postback and dynamically loadiing user controls. What am I doing ... On the master page is the named "mnuTicketMan". Inside the menuItemClick event handler, I have the following code: mvTicketMan. ...
Walkthrough: Creating and Using ASP.NET Master Pages in Visual Web ... You will then use a table to lay out the master page with a menu, a logo, ..... Double-click the button to create a handler for its Click event, ...
Master Pages In ASP.NET 2.0 Jul 18, 2005 ... To add a master page to a web project, right-click your web ... how we’ve added a Page_Load event handler to modify the color of the menu ...
HELP..! ASP.NET 2.0 MasterPage and menu Question.. - .NET ASP I have a masterpage define that contains a asp:menu control. ... is going to execute before the click event. Since your logic is ...
problems with referencing control from master page on content page referencing a menu control that is placed on a master page from a content ... WebControl Click Event Not Firing · Blank page after selection ...
ASP.NET.4GuysFromRolla.com: Passing Information Between Content ... Jan 31, 2007 ... Click 'Call the Main.master Master Page's DisplayDataFromPage method Master. .... The Page_Init event handler associates the Master Page's ...
CodeProject: ASP.NET 2.0 Master Pages. Free source code and ... Double click the white area of Content1, you will get the event handler of Page_Load .... controls in the Master page. Correct the problem in code view: ...




Search This Site:










module mechanics tutorials (free)

setting up an sql connection

how can i retrieve who i am after logging in to my website?

sha1managed() not found

how can i automate the creation of default users in asp.net?

funny things going on...

how disable user.identety.name credential cache

xml file structure

regarding tree view

major major css overiding issue!!! please help

please help login variable sessions

have to explicitly add resources to project after conversion

login control => custom database => "remember me" does not validate user again?

does anyone know how to edit catalook?

[:'(] [help]webpart can't work in iis

forms authentication with active directory in multiple domains in asp.net 2.0 fails if one domain credential is incorrect

rss information for links doesn't seem to show up anywhere

forms authentication ---- how to make page expire?

page level control?

how to get data from textbox into the sql database table plz help...

menu selected item

error creating set and deployment

purgeeventlog

file security in dnn 3.2

dnn.com forums are busted...

windows authentication - child portals

modules missing from 3.1.1

.net studio 2005 with 1.1 framework?

hosting need of asp 2.0 and sql 2005

stopping windows authentication sometimes

 
All Times Are GMT