CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 10/30/2007 8:27:29 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 50 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
IMBack
Asp.Net User
Question:Master Page + siteMap10/30/2007 8:27:29 PM

0/0

Hi,

 

I am displaying a menu, with sub menu

Websites
   - Google
   - Hotmail

Using Master Page, SiteMap and aspx file.

Master Page (contains)

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" enabletheming="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">

 

<table border="1" cols="2" bgcolor="aqua">

 

<tr>

<td>

    <asp:Menu ID="mainMenu"
              DataSourceID="siteMapDS1"
              runat="server"
              StaticEnableDefaultPopOutImage="true"
              Orientation="Horizontal"
              StaticDisplayLevels="1"
              MaximumDynamicDisplayLevels="1">             
   </asp:Menu>
    
    <asp:SiteMapDataSource id="siteMapDS1" runat="server" showstartingnode="true" />  

</td>

</tr>

</table>

    </form>
</body>
</html>
 

 

SiteMap


<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~Default.aspx" title="Home"  description="Home page">
        <siteMapNode url="" title="Websites"  description="Form Desc" />
          <siteMapNode url="http://www.google.ca" title="google" description="descr" />
          <siteMapNode url="http://www.hotmail.com" title="hotmail" description="descr" />
    </siteMapNode>
</siteMap>

aspx file (default)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" MasterPageFile="~/Site.master" %>
<%@ MasterType VirtualPath="~/Site.master" %>

 

Ques:

1. How does it interect between SiteMap and Master Page.   (how does it work behid the seen)

2. WHen I rollover on submenu (ex.hotmail) how can I set a color so I will know which one I am currently on

3. Only the Home (main menu) is aqua and not other sub menus. Not sure why..

Thank you

 

MaineOne
Asp.Net User
Re: Question:Master Page + siteMap10/30/2007 10:44:21 PM

0/0

 1. The aspx and Masterpage are combined when loaded. This allows you to easily control the look of the entire site from one masterpage as apposed to changing several aspx pages. The sitemap is basically a datasource for the navigation controls.

2. You can either create a css class to control the look and feel or you can change it on the Master page by adding

StaticMenuItemStyle-ForeColor=DarkBlue 


              DataSourceID="siteMapDS1"
              runat="server"
              StaticEnableDefaultPopOutImage="true"
              Orientation="Horizontal"
              StaticMenuStyle-ForeColor=DarkBlue
              StaticDisplayLevels="1"
              MaximumDynamicDisplayLevels="1">             
   
3. Not sure 
[email protected]

IMBack
Asp.Net User
Re: Question:Master Page + siteMap10/31/2007 2:50:48 PM

0/0

For the first question:

If I take away the code below from master page

DataSourceID="siteMapDS1" and   <asp:SiteMapDataSource id="siteMapDS1" runat="server" showstartingnode="true" /> 

--> It will not link the site map to master page. As you said sitemap is?The sitemap is basically a datasource for the navigation controls.? 

 ==================

A. So it links as long as I put anything in DataSourceID and asp:SiteMapDataSource id  

B. So my understanding .Net just knows to link it together if the datasourceId is included (by default), Is it correct?  

C. But what if I have more than one sitemap ( 2 menus), how does it know which one to map to?
 

THANK YOU!!

Amanda Wang - M
Asp.Net User
Re: Question:Master Page + siteMap11/1/2007 6:30:07 AM

0/0

Hi,

The sitemapdatasource control can access the sitemap defaultly.

The sitemap file name specified is web.sitemap , and the location is also fixed, viz.must be at the application's root directory.

So event if you didnot set the  property of connecting to the datasource, the sitemapdataource also can find the sitemap file according to the default default rule. 

So if you

IMBack:

take away the code below from master page

DataSourceID="siteMapDS1" and   <asp:SiteMapDataSource id="siteMapDS1" runat="server" showstartingnode="true" /> 

So the menu on the master page can not link to the sitemap. 

IMBack:

2. WHen I rollover on submenu (ex.hotmail) how can I set a color so I will know which one I am currently on

You can set the menu's  staticselectedstyle and dynamicselectedstyle, they are used to set the selected item's style.   

 

IMBack:

3. Only the Home (main menu) is aqua and not other sub menus. Not sure why..

 

You can try to use the Css Menu Adapter of the ASP.NET 2.0 CSS Friendly Control Adapters collection.

The css menu adapter can "teach" the Menu how to produce this kind of CSS friendly HTML without sacrificing the power and flexibility of the original Menu control.control.

 

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
IMBack
Asp.Net User
Re: Question:Master Page + siteMap11/1/2007 3:36:22 PM

0/0

Thank you for your help. 

But I am still a little bit confused.
I dont understand when you say:

The sitemapdatasource control can access the sitemap defaultly. 
1.Does this mean, it links as long as I put anything in DataSourceID and asp:SiteMapDataSource Id, and it just finds the sitemap file and links it to the master file (defaulty) Is it correct?

The sitemap file name specified is web.sitemap , 
and the location is also fixed, viz.must be at the application's root directory. 
2. I dont have the location fixed in master file with sitemap.
 
3.what if I have more than one sitemap ( 2 menus), how does it know which one to map to? "where is the relationship"
Thank you.. 
  
 
 
Amanda Wang - M
Asp.Net User
Re: Question:Master Page + siteMap11/2/2007 2:43:53 AM

0/0

Hi

IMBack:

The sitemapdatasource control can access the sitemap defaultly.
1.Does this mean, it links as long as I put anything in DataSourceID and asp:SiteMapDataSource Id, and it just finds the sitemap file and links it to the master file (defaulty) Is it correct?  
  

My answer is yes, but your sitemap file must be in the root directory, and the sitemap file's name must be web.sitemap.

IMBack:

The sitemap file name specified is web.sitemap ,
and the location is also fixed, viz.must be at the application's root directory.

2. I dont have the location fixed in master file with sitemap.
  

In fact, it is not importent where the master page file located, the Web.sitemap file must be located in the application root directory. If the sitemap file is not in the root directory, you should do some config in the we.config file. (You can refer the code I post it at the below)

IMBack:

3.what if I have more than one sitemap ( 2 menus), how does it know which one to map to? "where is the relationship"
  

If you have more than one sitemap files in the application.

Firstly, To configure multiple site maps in the Web.config file

For example:

<siteMap>
   <providers>
    <add name="Web" type="System.Web.XmlSiteMapProvider" siteMapFile="web.sitemap"/>/// the sitemap file is in the root directory
    <add name="Web2" type="System.Web.XmlSiteMapProvider" siteMapFile="web2.sitemap"/>/// the sitemap file is in the root directory
    <add name="Web3" type="System.Web.XmlSiteMapProvider" siteMapFile="web3.sitemap"/>/// the sitemap file is in the root directory
        <add name="Web4" type="System.Web.XmlSiteMapProvider" siteMapFile="~/SiteMaps/web.sitemap"/> // the sitemap file is not in the root directory
   </providers>
  </siteMap>

Then set the sitemap provider for sitedatasource control.

For Example:

   this.SiteMapDataSource4.Provider =  SiteMap.Providers["Web4"];

   this.SiteMapDataSource1.Provider =  SiteMap.Providers["Web"];
   this.SiteMapDataSource2.Provider = SiteMap.Providers["Web2"];
   this.SiteMapDataSource3.Provider = SiteMap.Providers["Web3"];

So the sitemapdatasource will link to the different sitemap files.

You can read more in this MSDN article:  How to: Configure Multiple Site Maps and Site-Map Providers 

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
IMBack
Asp.Net User
Re: Question:Master Page + siteMap11/2/2007 2:30:48 PM

0/0

THANK You very much!! for your help!!Smile

7 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET 2.0 MVP Hacks and Tips Authors: David Yack, Joe Mayo, Scott Hanselman, Fredrik Normén, Dan Wahlin, J. Ambrose Little, Jonathan Goodyear, Pages: 400, Published: 2006
Mastering Web Development with Microsoft Visual Studio 2005 Authors: John Paul Mueller, Pages: 822, Published: 2005
ASP.NET 2.0: A Developer's Notebook Authors: Wei Meng Lee, Pages: 326, Published: 2005
Visual C# 2005: A Developer's Notebook Authors: Jesse Liberty, Pages: 221, Published: 2005
Expert ASP.NET 2.0 Advanced Application Design: Advanced Application Design Authors: Dominic Selly, Andrew Troelsen, Tom Barnaby, Pages: 459, Published: 2005
Architectures for E-Business Systems: Building the Foundation for Tomorrow's Success Authors: Sanjiv Purba, Pages: 824, Published: 2001
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
Pro Ajax and the .NET 2.0 Platform Authors: Daniel Woolston, Pages: 463, Published: 2006
Search Engines for the World Wide Web: Visual QuickStart Guide Authors: Alfred Glossbrenner, Emily Glossbrenner, Pages: 360, Published: 2001
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005

Web:
Question:Master Page + siteMap - ASP.NET Forums Question:Master Page + siteMap. Last post 11-02-2007 10:30 AM by IMBack. 6 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
CodeProject: Using Menu and Sitemap with Master page. Free source ... This article explains how to use Sitemap with Master pages to create a .... So, I have one question. When I select in a child (vertical) menu one of the ...
Template Question - Master Index Page - Movable Type Community Forum Template Question - Master Index Page, Master Index of all entries by category ... The idea is to have a sort of site map of all the posts. ...
ASP.NET MasterPage Questions : The Official Microsoft Silverlight Site NET assembly has also received a new item - the "web.sitemap" file and a ... Question #4 : Let's assume that I'd like the MasterPage to have ...
GameSpot Forums - Ninja Gaiden II - Another chapter 2 question ... Next Page. Previous Page. Page 1. Forums - Ninja Gaiden II - Another chapter 2 question (master ninja ... Ninja Gaiden II ...
Master Bond Site Map -- Main Page Site Map of MasterBond.com. Master Bond Home Page -- Providing the Best in ... Master Bond Technical Questions That Should Be Asked When Considering The Use ...
Scott on Writing I just updated the site map data, so go ahead and rebind the site map ... This begs the question, How do you get the content page and Master Page talking? ...
question master: Information from Answers.com The noun question master has one meaning: Meaning #1 : (British) the. ... Post a question or answer questions about "question master" at WikiAnswers. ...
Google Webmaster Central ... of Google's indexing of your website, including Sitemap submission and reporting. Sign in to Webmaster Tools. Find answers to webmaster questions ...
ASP.NET Master Pages - Interview Questions Sitemap of www.CareerRide.com, Sitemap, FAQ related with www.CareerRide.com ... Question - Advantages of using Master Page in ASP.NET ...

Videos:
Project 3: Digital Portfolio Pre-Production Everyone can use a digital portfolio. It is a way to portray who you are and what you can do. This video begins the construction of a digital portfol...
PSTI Sample Video #3 Participants in the 2007 NASA / NIA / Fresno State Pre-Service Teacher Institute discovered how to use 21st century communication skills to help them...




Search This Site:










problem in master page

css for master

how to set focus on treenode?

custom page base referencing my master page type.

don't want to copy *.css file to every sub directory

findcontrol in masterpage problem

side menu w/ contentplaceholder as target

master page with menu

masterpage error: make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. page or usercontrol).

classic theme...

placing button next to horizontal menu - how?

loginname control won't display in a contents page

left side scroll bars?

second level of menu

error on one treeview raised in other treeview on same page

treeview, how to set selectaction when using sitemap?

widget/control attachments

more than one sitemaps

vertical alignment problem using master pages

how to add to the contents area during runtime

masterpage - height="100%"

images not working in a standard treeview

adding image as a watermark to all web pages

gridview skin

checkbox treeview question

what is problem with runat=server ??

problem setting theme on tablecell

how to expand a treenode

treeview change selected node event

textbox in menu dynamic item...

  Privacy | Contact Us
All Times Are GMT