473,385 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Web.sitemap and target of the URL

Joe
I have a web.sitemap file that has the url title and description. I then
have this attac attached to a menu. I want some of my menu choices to open
up in a page in a new window ie _blank as target. How do I do this with a
web.sitemap file
Dec 31 '05 #1
1 6874
I was able to get window.open to work, as well as target='_blank'. Try this:

For target - In your web.sitemap file, add an XML attribute called "target".
(<siteMapNode title="Durham" url="http://www.website.com/Durham.pdf"
pop_up="" target="_blank"/>) This attribute is not required for every node.

For window.open - In your web.sitemap file, add an XML attribute called
"pop_up". You will have to add this to every node that contains a "URL"
attribute. Set to "" when using a URL, set to the url when using pop_up. URL
attribute must have a value.
(<siteMapNode title="Durham" url="duh" pop_up_width="210"
pop_up_height="210" pop_up="http://www.website.com/Durham.pdf"/>)

Optionally you can set a height and width attribute in your web.sitemap file.

Then in your code...

protected void Menu1_MenuItemDataBound(object sender, MenuEventArgs e)
{
e.Item.Target = ((SiteMapNode)(e.Item.DataItem))["target"];

if (((SiteMapNode)(e.Item.DataItem))["pop_up"] != "")
{
e.Item.NavigateUrl = "javascript:OpenWindow('" +
((SiteMapNode)(e.Item.DataItem))["pop_up"] + "'," +
((SiteMapNode)(e.Item.DataItem))["pop_up_width"] + "," +
((SiteMapNode)(e.Item.DataItem))["pop_up_height"] + ")";
}
}

You will need to add this to your .aspx file...

<script language="javascript">
function OpenWindow(URL,W,H)
{
var WindowName = "MyPopup";
var Features = "width=" + W + ",height=" + H + ",location=no,
toolbar=no, menubar=no, resizable";
window.open(URL, WindowName, Features);
}
</script>

and lastly - add this to your <asp:Menu tag...

OnMenuItemDataBound="Menu1_MenuItemDataBound"
"Joe" wrote:
I have a web.sitemap file that has the url title and description. I then
have this attac attached to a menu. I want some of my menu choices to open
up in a page in a new window ie _blank as target. How do I do this with a
web.sitemap file

Feb 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: chris.rust | last post by:
Has anyone else had any trouble setting up a sitemap view to be filtered by roles? We've put a cust role provider in place, and we can verify that it's only being called once for each...
0
by: mike | last post by:
I'm having two problems with my Menu control that I'm yet to find answers to. I am configuring my Menu control from a SiteMap data source. 1. Those menus which are pull-downs are still...
1
by: mike | last post by:
I have 2 sites in my company. My .NET site uses a master page and a Menu control connected to a sitemap. In my sitemap file I would like to be able to do something like this: <sitemap>...
5
by: JJ | last post by:
Although this question involves Flash, I suspect the actual issue is an asp one.. I am trying to open the web.sitemap file in an .swf file enbedded in an asp page (I'm working in VS 2005). I...
4
by: shapper | last post by:
Hello, I have 2 questions about Asp.Net 2.0 web.sitemap: 1. Where can I find the list of all siteMapNode attributes? I looked eveywhere and couldn't find it. 2. I created a Web.sitemap...
4
by: shapper | last post by:
Hello, I am trying to convert an Asp.Net 2.0 XML sitemap file to a Google's sitemap file. I am posting the formats of both files. 1. How can I do the conversion? 2. And can I use an...
1
by: Alec MacLean | last post by:
Hi. I'm using VS2005 Pro to work on a website project for my company. The site has several navigation elements, all based on the standard VS2005 navigation components. I have high-level...
5
by: Tim Mackey | last post by:
hi, i have put my web.sitemap in /App_Data so i can edit it programatically via a web admin page, inheriting the modify permissions from the App_Data folder etc. i was hoping the provider would...
6
by: Olagato | last post by:
I need to transform this: <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <url> <loc>http://localhost/index.php/index./Paths-for-the-extreme-player</ loc> </url> <url>...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.