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: 4/9/2008 12:43:05 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 50 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
r_nassabeh
Asp.Net User
SiteMapNode Title4/9/2008 12:43:05 PM

0/0

Hi

I have an aold problem with XmlSiteMapProvider and the Asp.Net menu, I want to append a string (e.g "*") to the title of all menu items, but when I modify the title of the SiteMapNode in the SiteMap_SiteMapResolve, it says that this is readonly and can not be changed, Is there any alternative to do so? do I need to implement a custome sitemap provider or I can do this using the Asp.Net menu?

Any kind of help is highly appreciated.


Good Luck!

Reza Nassabeh


Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
thirumaran007
Asp.Net User
Re: SiteMapNode Title4/9/2008 1:09:15 PM

0/0

Hi Friend,Just add the * in the site map nodes statically and when you list out these sitemap nodes to the menu item then you can see the *. If you don?t want to display the * in menu item simply you can remove the * dynamically  

 


With Friendly,
Thirumaran

Please remember to click "Mark as Answer" on this post if it helped you
Dave Sussman
Asp.Net User
Re: SiteMapNode Title4/9/2008 4:37:45 PM

0/0

You can't modify the node, as you've discovered, but what you do is just return a new node from the resolve event. Eg:

SiteMapNode n = e.Provider.CurrentNode.Clone();
n.Title = e.Provider.CurrentNode.Title += "*";
return n;

Or you can construct a new SitemapNode and just set the properties.

r_nassabeh
Asp.Net User
Re: SiteMapNode Title4/10/2008 7:04:42 AM

0/0

Hi

I have done it in my masterpage.cs as follows:

 

protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    SiteMap.SiteMapResolve += new SiteMapResolveEventHandler(SiteMap_SiteMapResolve);
}

SiteMapNode SiteMap_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
{
    if (e.Provider.CurrentNode != null)
    {
        SiteMapNode n = e.Provider.CurrentNode.Clone();
        n.Title += "*";
        return n;
    }
    else
        return null;
}
 but to my suprise it always returns the original unmodified title, even when I manually modify the title in debug mode, it reverts to its original value. I can not find a logical reason for such a behavior!
Good Luck!

Reza Nassabeh


Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
r_nassabeh
Asp.Net User
Re: SiteMapNode Title4/10/2008 7:36:08 AM

0/0

To make the problem more complicated, I tried the followin code, but even this one does not change the menu, it always insists on its original values derived from Site.SiteMap

if (e.Provider.CurrentNode != null)
{
    SiteMapNode n = new SiteMapNode(e.Provider, e.Provider.CurrentNode.Key, "www.yahoo.com", "test", "description");
    return n;
}
else
    return null;
 now I'm sure that the problem resides somewhere else (because this code must obviously work) but I dont know where to look for it.
Good Luck!

Reza Nassabeh


Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
Dave Sussman
Asp.Net User
Re: SiteMapNode Title4/11/2008 7:59:23 AM

0/0

You know what, now I'm having the same problem. I've definitely had this working (http://www.ipona.com/samples/ANV201%20-%20ASP.NET%202.0%20Navigation.zip), but it doesn't seem to in a test project at the moment. One thing I did miss out is that you need to set the parent, so that the node you return is attached to another node. Eg:

n.ParentNode = SiteMap.Provider.RootNode

I'll keep digging into this.

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


Free Download:

Books:
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Programming Visual Basic 2005 Authors: Jesse Liberty, Pages: 548, Published: 2005
Essential ASP.Net 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2006
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 954, Published: 2007
ASP.NET 2.0 Cookbook Authors: Michael A. Kittel, Geoffrey T. LeBlond, Pages: 989, Published: 2005

Web:
SiteMapNode.Title Property (System.Web) .NET Framework Class Library. SiteMapNode.Title Property ... Dim instance As SiteMapNode Dim value As String value = instance.Title instance.Title = value ...
SiteMapNode.Title Property (System.Web) Gets or sets the title of the SiteMapNode object. ... SiteMapNode.Title Property . Note: This property is new in the .NET Framework version 2.0. ...
ASP.NET 2.0: Using the Menu Control < siteMapNode title="Sales" description="The Sales Site" url="SiteMaps.aspx?id=2"> ...
siteMapNode title is toooooo long. - ASP.NET Forums siteMapNode title is toooooo long. Last post 09-11-2008 2:16 AM by Amanda Wang - MSFT. 1 replies. Sort Posts: ...
web.sitemap NET 2.0 - The Beta Version Samples"> element is required directly inside the ..." target="_" >"Exactly one element is required directly inside the ... ... < siteMapNode title="xxxx"> ...
Wheres the Target for siteMapNode? - .NET ASP ...
Menu Control NET" url="~/dotnetSample/default.aspx" description="Go To Chapter 1"> < siteMapNode title="Simple DataSet" url="~/dotnetSample/DataSet_ex.aspx" ...
xpath attribute help [Archive] - WebDeveloper.com menu control with sitemap ... < siteMapNode title="HR" imageUrl="images/softwarenor.jpg" url="linkpage.aspx"> ...




Search This Site:










create a custom login view

need help with the daab and multiple databases.

project managment module within dnn

restoring a complete site.

dotnetnuke source code on gotdotnet??

why can aspx code access files outside the virtual directory? eg. program files

does anyone have a viewstate manager?

edit command in datagrid

server only works when localhost

dynamic title & meta tags

excempting pages from forms authentication

how to catch invalid urls to a deleted portal? 3.x

thread was being aborted

output opinion

asp.net 2.0 beta web app admin help

c:\dotnetnuke\controls\address.ascx.vb(28): 'countrylistbox' is ambiguous in the namespace 'dotnetnuke.web.ui.webcontrols'.

deployment of ie web controls

can't decrypt config section use default provider (aspnet_regiis -pe)

css files are references multiple times in the head tag

html editing module

don't display full paths in the window tabs?

horizontal treeview?

timeclock module

are any events fired when an editorzone updates personalization data?

incompatibilities in .net vs php encryptions

login page vanished

programmatic impersonation, ad authentication fails under server 2003

oracle provider for dnn 3.2

database db = databasefactory.createdatabase(); throws an exception.

why can i use a server tag in a createuserwizardstep contenttemplate but not in a changepasswordtemplate?

 
All Times Are GMT