CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
Explore    Item Entry    Members   
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 > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 7/22/2007 11:41:31 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 9 Views: 9 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
10 Items, 1 Pages 1 |< << Go >> >|
Rahabm
Asp.Net User
Creating image based site navigation using standard sitemap7/22/2007 11:41:31 PM

0/0

I know how to create a normal menu and change them the way i want using css, but I dont know how to use images instead of text.

I want to make it look cooler using images so in order to do that, I haven't got any ideas at all :(

I have seen many websites on internet like this and I dont think its a difficult thing to do for some of you here.

Could you please guide me or show me the way forward ?

 

Thanks.

 


Atlas + ASP .net 2.0 = The best !
Rahabm
Asp.Net User
Re: Creating image based site navigation using standard sitemap7/23/2007 8:38:10 AM

0/0

 This is what I have been trying to do so far but the code simply doest show those images :(

Could you please help with this ? Thank you

 

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/Default.aspx" title="Home" imageName="buttons_01.jpg" description="">
      <siteMapNode url="~/Auction.aspx" title="Food Auction!"  description="Food Auction! (number one in the world)" imageName="buttons_02.jpg"/>
        <siteMapNode url="~/Start.aspx" title="Find and Order"  description="Find and order your food." imageName="buttons_03.gif">
            <siteMapNode url="~/Search.aspx" title="Find Restaurant"  description="Find your food." imageName="buttons_03.gif"/>
        </siteMapNode>
    </siteMapNode>
</siteMap>
 

and the code to achieve that :

 

 

          <asp:SiteMapDataSource ID="srcBuckets" runat="server" ShowStartingNode="False" />


   <ul>
        <li><asp:HyperLink runat="server" ID="lnkHome" ImageUrl='./images/buttons_01.jpg' NavigateUrl="~/Default.aspx">Home</asp:HyperLink></li>

 <asp:Repeater runat="server" ID="menu" DataSourceID="srcBuckets" EnableViewState="false">
    <ItemTemplate>
        <li>
            <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl='./images/<%# Eval((SiteMapNode)Container.DataItem)["imageName"]) %>' NavigateUrl='<%# Eval("Url") %>'> <%# Eval("Title") %></asp:HyperLink>

            <asp:Repeater ID="Repeater1" runat="server" DataSource='<%# ((SiteMapNode) Container.DataItem).ChildNodes %>' EnableViewState="false">
                <HeaderTemplate>
                    <ul>
                </HeaderTemplate>

                <ItemTemplate>
                    <li>
                        <asp:HyperLink ID="HyperLink2" runat="server" ImageUrl='images/<%# ((SiteMapNode)Container.DataItem))["imageName"] %>;' NavigateUrl='<%# Eval("Url") %>'> <%# Eval("Title") %></asp:HyperLink>
                    </li>
                </ItemTemplate>

                <FooterTemplate>
                    </ul>
                </FooterTemplate>
            </asp:Repeater>
        </li>
    </ItemTemplate>
</asp:Repeater>
    </ul>
  

I appreciate if you share any information that you might think it will help me.

Thank you.
 


 


Atlas + ASP .net 2.0 = The best !
Rahabm
Asp.Net User
Re: Creating image based site navigation using standard sitemap7/23/2007 10:22:34 PM

0/0

Any body please ? What do you think is wrong with my code ? 


Atlas + ASP .net 2.0 = The best !
Amanda Wang - M
Asp.Net User
Re: Creating image based site navigation using standard sitemap7/25/2007 3:21:17 AM

0/0

Hi,

Rahabm:

but I dont know how to use images instead of text.

You can set the text of the menuitem to image control, for example:  

<asp:MenuItem ToolTip="Home"  Text="<img runat='server' src='../../image/button-search.gif' />" Value="Home" NavigateUrl="~/Menu/Menu.aspx" >

  Then the menuitem's text will be repalce with an image.

 

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
Rahabm
Asp.Net User
Re: Creating image based site navigation using standard sitemap7/25/2007 11:42:32 AM

0/0

Thanks, but I want to use SiteMap xml file, this is kind of hard coded right ? i need something more dynamic ?


Atlas + ASP .net 2.0 = The best !
tande
Asp.Net User
Re: Creating image based site navigation using standard sitemap7/25/2007 8:21:25 PM

0/0

Maybe something like this?

 

  Private hshPages As Hashtable
  Private Sub loadHash()
    hshPages = New Hashtable
    '-- Add Pages and images for them to the hash
    hshPages.Add("/Test/default.aspx".ToLower(), "help.jpg")
  End Sub


  Protected Sub Menu1_MenuItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemDataBound
    If hshPages.Contains(e.Item.NavigateUrl.ToLower()) Then
      e.Item.Text = "<a href=""" & e.Item.NavigateUrl & """><image border=""0px""  src=""" & hshPages.Item(e.Item.NavigateUrl.ToLower()).ToString() & """ /></a>"
    End If
  End Sub

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    loadHash()
  End Sub


(Please MARK this post as ANSWERED, if you find it helpful)
Rodashar
Asp.Net User
Re: Creating image based site navigation using standard sitemap7/25/2007 10:04:54 PM

0/0

I did somethign very similar to tande's example. I used the sitemap xml file and set a custom property of "ImageUrl" (Sample code below). After that I used the menuitemsdatabound event and assigned the SiteMapNodes's ImageUrl value to the MenuItems ImageUrl property. Let me know if this helps.

 

//Sitemap example 

<siteMapNode>

 

<
siteMapNode title="Support" url="#Support" ImageUrl="Images/mnu_support.jpg"></siteMapNode>

 

<
siteMapNode title="Downloads" url="#Downloads" ImageUrl="Images/mnu_downloads.jpg"></siteMapNode>

 

<
siteMapNode title="Purchase" url="#Purchase" ImageUrl="Images/mnu_purchase.jpg"></siteMapNode>

 

<
siteMapNode title="Activation" url="#Activation" ImageUrl="Images/mnu_activation.jpg"></siteMapNode>

 

</siteMapNode>

 

//MenuItemDataBound Example

Dim node As SiteMapNode = CType(e.Item.DataItem, SiteMapNode)       //Gets the current node

If node("ImageUrl") IsNot Nothing Then          //Checks if the node has a ImageUrl property assigned

e.Item.ImageUrl = node("ImageUrl")         //Assigns the SiteMapNode ImageUrl to the MenuItem ImageUrl property   

e.Item.Text = String.Empty       //This code removes the text from the SiteMap Node. This could possibly also be done by leaving the Title property empty for the SiteMapNode

End If


Remeber to mark as Answer if someone's answer helped you.
Rahabm
Asp.Net User
Re: Creating image based site navigation using standard sitemap8/3/2007 10:13:33 PM

0/0

What would be the code in C# ? 


Atlas + ASP .net 2.0 = The best !
Rodashar
Asp.Net User
Re: Creating image based site navigation using standard sitemap8/3/2007 10:21:18 PM

0/0

protected void MenuItemDataBound(object sender, System.Web.UI.WebControls.MenuEventArgs e)
{
MenuItem item = (MenuItem)e.Item;
SiteMapNode node = (SiteMapNode)item.DataItem;

if (node("ImageUrl") != null)
{
item.ImageUrl = node("ImageUrl");
item.Text = string.Empty;
}
}


Remeber to mark as Answer if someone's answer helped you.
ovaisgeo
Asp.Net User
Re: Creating image based site navigation using standard sitemap1/21/2008 9:48:33 AM

0/0

its working great

 

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



Search This Site:


Meet Our Sponsors:



Other Resources:

Creating an image with ZAM on it. - novell.support.zenworks.asset ... Is there a "best practices" way to create a base image with the ZAM client ... Search This Site: Related Web Resources: Creating an image with ZAM on it. ...
Creating a GoLive Site navigation and links are based. ADOBE GOLIVE CS2. 77. Classroom in a Book ... Keep your site consistent by using a standard color palette for your pages. By using the ...
Nifty Navigation Tricks Using CSS [CSS Tutorials] Search Site. Advanced Search. Sitemap. Home. Articles. Books. Kits ... In the previous section, we learned to create image- and JavaScript-free rollovers. ...
Creating CD-based HTML presentations - FrontPage - Microsoft Office Online On a standard Web site, users browse using the navigation that you provide. ... that you should create now is a site map page to act as a map of your Web site. ...
ASP.NET.4GuysFromRolla.com: Examining ASP.NET 2.0's Site Navigation ... ... shows how to create a simple site map using the default XML-based site map provider ... There are the standard WebControl formatting properties - BackColor, Font, ...
PHP Site Navigation Tutorials and Tips :: Hot Scripts While using standard HTML elements (unordered lists) it's easy to add different ... users with an index/sitemap that they can use to easily navigate through ...
Types of web site navigation systems Image based navigation systems can also consist of image maps, in which one ... There are three advantages of creating a Flash based navigation bar. ...
Creating Advanced MySQL-Based Virtual Hosts On Lighttpd (Debian Etch ... VMware Image Import Guide. List of all VMware Images. Free Support. Paid Support. Navigation ... Site Map/RSS Feeds. User login. Username: Password: Remember Me? ...
Inside Microsoft: Structuring an ASP.NET 2.0 Site using Master Pages ... ... want to build a site that has standard headers and navigation bars in ASP.NET 1. ... is crucial when it comes to creating a content page based on this master. ...


 
All Times Are GMT