Subject: Bookmark this page link in Master page
Posted By: dschips Post Date: 1/4/2007 7:14:30 PM
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

Reply By: planoie Reply Date: 1/5/2007 9:06:55 AM
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
Reply By: dschips Reply Date: 1/5/2007 11:08:16 AM
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

Reply By: planoie Reply Date: 1/5/2007 2:05:24 PM
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
Reply By: dschips Reply Date: 1/5/2007 11:06:47 PM
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

Reply By: planoie Reply Date: 1/8/2007 10:05:00 AM
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

Go to topic 54428

Return to index page 70
Return to index page 69
Return to index page 68
Return to index page 67
Return to index page 66
Return to index page 65
Return to index page 64
Return to index page 63
Return to index page 62
Return to index page 61