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





Zone: > NEWSGROUP > Asp.Net Forum > microsoft_downloads.css_friendly_control_adapters Tags:
Item Type: NewsGroup Date Entered: 3/20/2007 3:23:03 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 27 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
1 Items, 1 Pages 1 |< << Go >> >|
whatispunk
Asp.Net User
Menu Adapter with Sitemap doesn't fire OnClick3/20/2007 3:23:03 AM

0/0

Okay. I am pretty new to these adapters. In fact I am just plain new. I am trying to use the menu adapter and a sitemap to create a horizontal menu that will show the starting node of the sitemap "HOME" and the second tier as well. So it looks like

Home > Projects > Solutions >

Also, the OnClick even doesn't seem to fire now that I am using a datasource rather than Item tags.

Here's the code I am using:

<%@ Page Language="VB" %>

<script runat="server">
 Public Sub OnClick(ByVal sender As Object, ByVal e As MenuEventArgs)
  MessageLabel.Text = "You selected " & e.Item.Text & "."
  e.Item.Selected = True
 End Sub
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
 <link href="~/WalkThru/SimpleMenu.css" rel="stylesheet" type="text/css" />
 <link id="AdaptersInvariantImportCSS" runat="server" href="~/CSS/Import.css" rel="stylesheet"
  type="text/css" />
 <!--[if lt IE 7]>
    <link runat="server" rel="stylesheet" href="~/CSS/BrowserSpecific/IEMenu6.css" type="text/css" id="IEMenu6CSS" />
<![endif]-->
</head>
<body>
 <form id="form1" runat="server">
  <div>
   <asp:Menu ID="EntertainmentMenu" runat="server" CssSelectorClass="SimpleEntertainmentMenu"
    DataSourceID="SiteMapDataSource1" OnMenuItemClick="OnClick"
    Orientation="Horizontal" >
   </asp:Menu>
   <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false"/>
  </div>
  <div id="EntertainmentMessage">
   <asp:Label ID="MessageLabel" runat="server"></asp:Label>
  </div>
 </form>
</body>
</html> 

As you may notice, this is basically the SimpleMenu example with some minor changes. I removed the <item> tags in lieu of using a site map for my datasource. However, the OnMenuItemClick event doesn't seem to fire when you click on one of the items. I don't even know where to begin looking for the problem. Any help would be greatly appreciated.

 I only created a very basic sitemap as follows:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="" title="Home"  description="">
      <siteMapNode url="" title="Projects"  description="Projects" >
        <siteMapNode url="" title="Projects1"  description="" />
        <siteMapNode url="" title="Projects2"  description="" />
      </siteMapNode>
      <siteMapNode url="" title="Solutions"  description="" >
        <siteMapNode url="" title="Solutions1"  description="" />
        <siteMapNode url="" title="Solutions2"  description="" />
      </siteMapNode>
     
    </siteMapNode>
</siteMap>

Unfortunately it doesn't seem like the StaticDisplayLevels has any effect on the menu. When ShowStartingNode is set to true I only see Home, when it is false I see Projects > Solutions >. I tried using the StartingNodeOffset but that didn't work, I also tried using the StaticDisplayLevels too. Neither worked.

Thanks.


Simple minds think alike. Great minds come up with something different.
1 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

Multiple or Reentrant NLM - novell.devsup.libc - Web Programming Newsgroups ... on another load command, and have those parameters handed t= o ... 8/12/2004 5:39:19 AM. Reply. 0/0. There seems to be ... menu adapter with sitemap doesn't ...
TheMSsForum.com >> Asp >> How to add adapters - The Microsoft Software ... ... sitemap, I would like to add a second level to at least one of the menu choices. ... Dim adapter As New Data.SqlClient.SqlDataAdapter(cmdTopic) With cmdMedia. ...
.NET C# Page 25 - Bytes Site Map Custom Control To Emulate Start Menu Behavior. Simple animation and stuff... Ienumberable<T> / Event Handler design question...
.NET C# Page 27 - Bytes Site Map Context Menu Click event - how to Identify the object that was right clicked ... Batched update using strongly typed table adapter ...
CodeProject: ASP.NET Discussion Boards. Free source code and ... N a v a n e e t h. 21:33 1 Nov '07 ... <button id="CallJS" onclick="showHtml();" disabled="disabled">Call method from new load</button> ...
p2p.wrox.com Forums - Any sites based on the book? By dropping the MS Menu and Web.SiteMap you seem to have lost the breadcrumbs. ... I don_ t know if it have something to do with the fact that I decompressed my ...
TheMSsForum.com >> Asp >> Response.End question - The Microsoft ... ... select the query in the table adapter and tell the parameter that it is ... 1" Content-Transfer-Encoding: quoted-printable Hi, I have a menu and a SiteMap. ...
Too Busy For Words - The PaulWay Weblog 2007 Fred's demonstration of DVB-T tuners in Kaffeine impressed many people. ... a menu environment has always indicated an option that was not available, he ...
Ask Metafilter | Community Weblog posted by the fire you left me at 7:57 PM PST - 54 comments ... at 6:39 PM PST - 12 comments ... and if so, what's the most yummilicious thing on the menu? ...
OXXus.net: Web Hosting Go to the neighbors and call the fire department. ... I think it can be resolved with extended menu, but not too sure about it. ...



 
All Times Are GMT