Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2007, 08:14 PM
Registered User
 
Join Date: Dec 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Bookmark this page link in Master page

I want to add a <asp:LinkButton> to my Master page. This means I need the correct url and the page name since these will be different for each content page. I can get these from my sitemap.

Is there a better way than using javascript? If not, how can I pass the sitemap info to the function?

TIA,
Diane

 
Old January 5th, 2007, 10:06 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What do you want that linkbutton to do? I assume that you want it to redirect the user to some page? It's not clear from your description what you want to achieve.

-Peter
 
Old January 5th, 2007, 12:08 PM
Registered User
 
Join Date: Dec 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry! I must have been really tired!

I want a bookmark link on the Master page. When the page is bookmarked, I want the correct url and page name. not, for example, the default page name everytime. I can get both from the sitemap, though the url may be correct without having to. The problem is I can't figure out how to pass the sitemap info to the javascript function. It doesn't have to be a <asp:LinkButton>, but I do want a link and not a button.

Also, is javascript still my only option?

Diane

 
Old January 5th, 2007, 03:05 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Isn't the user just going to use the browser to create a bookmark from the URL they are sitting on?

There are lots of programmatic ways of get the current page URL. For one, you could query the server variables, the current URL is in there at least a few times. Combining that with the host name from the server variables would give you the full current URL that the user sees in their address bar.

-Peter
 
Old January 6th, 2007, 12:06 AM
Registered User
 
Join Date: Dec 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I did figure that out about the URL. My problem is more with the page name. This will come from the sitemap page title, but I don't know how to pass it to the javascript function.

Diane

 
Old January 8th, 2007, 11:05 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

It sounds like the problem is really that you need to touch the <title> for each page you are on so that the browser reflects a more descriptive page name instead of the default that is on the master page. I'm sure how you do that (haven't spend much time in master pages yet) but I think there is programmatic access to the title tag thru either the page class itself or the Page.Master property.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Page Method: Code-Behind for Content Page kwilliams ASP.NET 2.0 Professional 3 June 2nd, 2008 12:57 PM
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
master page and content page interaction mrjoka ASP.NET 2.0 Basics 0 March 15th, 2007 10:45 AM
Access Master page control from Content page. angshujit ASP.NET 2.0 Basics 3 January 11th, 2007 06:20 AM
content page viewstate value in Master Page cbe_seenu ASP.NET 2.0 Professional 0 August 1st, 2006 01:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.