By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,248 Members | 1,705 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,248 IT Pros & Developers. It's quick & easy.

Wheres the Target for siteMapNode?

P: n/a
I can't beleive that Microsoft would create the whole Sitemap XML
datasource process but not have a TARGET tag. What am I missing? The
only place I saw the target tag was at the treeview level. Please tell
me that something this basic is at the siteMapNode level and not the
Treeview level?

Does anyone have a work around for this Design Flaw?

Oct 14 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
re:
What am I missing? The only place I saw the target tag was at the treeview level.
Robert Haken, MVP, provided this answer...

---000---

For all TreeView nodes, you can set

MyTreeView.Target = "_blank"; // or any other target

for only some of them, you can use the TreeNodeDataBound event:

protected void MyTreeView_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{
if( e.Node.NavigateUrl == "[url]" ) // get only this one item
e.Node.Target = "_blank"; // or any other target
}

---000---

re:
Does anyone have a work around for this Design Flaw?
Why do you consider that a "design flaw" ?

Which functionality do you think is missing ?


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ne*****@lni.wa.govwrote in message news:11*********************@i42g2000cwa.googlegro ups.com...
>I can't beleive that Microsoft would create the whole Sitemap XML
datasource process but not have a TARGET tag. What am I missing? The
only place I saw the target tag was at the treeview level. Please tell
me that something this basic is at the siteMapNode level and not the
Treeview level?

Does anyone have a work around for this Design Flaw?

Oct 14 '06 #2

P: n/a
Thank you for your time in responding to my query.
Here is an example how I figured it would work ... Note the "Target"
tag's on the url's that are PDF's
<siteMapNode title="Lakeridge - Home Page" description=""
url="LakeridgeWater.aspx">
<siteMapNode title="Articles of Incorporation" description=""
url="Articles.aspx" />
<siteMapNode title="Minutes for 2006" description="" >
<siteMapNode title="September 2006" description=""
url="minutes0912.pdf" target="_blank"/>
<siteMapNode title="August 2006" description=""
url="minutes0806.pdf" target="_blank" />
<siteMapNode title="July 20, 2006" description=""
url="minutes0720.pdf" target="_blank"/>
<siteMapNode title="July 11, 2006" description=""
url="minutes0711.pdf" target="_blank"/>
</siteMapNode>
<siteMapNode title="Bylaws" description="" url="bylaws.aspx" />
<siteMapNode title="Plot Map" description="" url="plotmap.aspx" />
</siteMapNode>
</siteMap>
I do not want it at the Treeview level. That means that all the
sitemapnodes will open up in a new window. I need to be able to pick
and choose what the target is.

I have some documents that are PDF documents, I need to open them up in
a new window so I do not loose the navagation.

I tried your sample code on my master page (I use vb not c#, sorry).
If I could get this to work, then I could set the e.Node.Target =
"_blank" if the url ends with "PDF". But, I could not get it to work.
It looks like you can overide the sitemap at databound time, but it
did not execute.

Protected Sub MyTreeView_TreeNodeDataBound(ByVal sender As Object,
ByVal e As TreeNodeEventArgs)
If e.Node.NavigateUrl = "[url]" Then
e.Node.Target = "_blank"
End If
End Sub
I put a breakpoint here but it did not stop on this subroutine. I put
this on the masterpage, is there somewhere else to put it?

Juan T. Llibre wrote:
re:
What am I missing? The only place I saw the target tag was at the treeview level.

Robert Haken, MVP, provided this answer...

---000---

For all TreeView nodes, you can set

MyTreeView.Target = "_blank"; // or any other target

for only some of them, you can use the TreeNodeDataBound event:

protected void MyTreeView_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{
if( e.Node.NavigateUrl == "[url]" ) // get only this one item
e.Node.Target = "_blank"; // or any other target
}

---000---

re:
Does anyone have a work around for this Design Flaw?

Why do you consider that a "design flaw" ?

Which functionality do you think is missing ?


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ne*****@lni.wa.govwrote in message news:11*********************@i42g2000cwa.googlegro ups.com...
I can't beleive that Microsoft would create the whole Sitemap XML
datasource process but not have a TARGET tag. What am I missing? The
only place I saw the target tag was at the treeview level. Please tell
me that something this basic is at the siteMapNode level and not the
Treeview level?

Does anyone have a work around for this Design Flaw?
Oct 14 '06 #3

P: n/a
I got it to work.

Thanks for your help. This is how it ended up looking.
Protected Sub MyTreeView_TreeNodeDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) _
Handles TreeView1.TreeNodeDataBound

If e.Node.NavigateUrl.EndsWith("pdf") Then
e.Node.Target = "_blank"
End If
End Sub

ne*****@lni.wa.gov wrote:
Thank you for your time in responding to my query.
Here is an example how I figured it would work ... Note the "Target"
tag's on the url's that are PDF's
<siteMapNode title="Lakeridge - Home Page" description=""
url="LakeridgeWater.aspx">
<siteMapNode title="Articles of Incorporation" description=""
url="Articles.aspx" />
<siteMapNode title="Minutes for 2006" description="" >
<siteMapNode title="September 2006" description=""
url="minutes0912.pdf" target="_blank"/>
<siteMapNode title="August 2006" description=""
url="minutes0806.pdf" target="_blank" />
<siteMapNode title="July 20, 2006" description=""
url="minutes0720.pdf" target="_blank"/>
<siteMapNode title="July 11, 2006" description=""
url="minutes0711.pdf" target="_blank"/>
</siteMapNode>
<siteMapNode title="Bylaws" description="" url="bylaws.aspx" />
<siteMapNode title="Plot Map" description="" url="plotmap.aspx" />
</siteMapNode>
</siteMap>
I do not want it at the Treeview level. That means that all the
sitemapnodes will open up in a new window. I need to be able to pick
and choose what the target is.

I have some documents that are PDF documents, I need to open them up in
a new window so I do not loose the navagation.

I tried your sample code on my master page (I use vb not c#, sorry).
If I could get this to work, then I could set the e.Node.Target =
"_blank" if the url ends with "PDF". But, I could not get it to work.
It looks like you can overide the sitemap at databound time, but it
did not execute.

Protected Sub MyTreeView_TreeNodeDataBound(ByVal sender As Object,
ByVal e As TreeNodeEventArgs)
If e.Node.NavigateUrl = "[url]" Then
e.Node.Target = "_blank"
End If
End Sub
I put a breakpoint here but it did not stop on this subroutine. I put
this on the masterpage, is there somewhere else to put it?

Juan T. Llibre wrote:
re:
What am I missing? The only place I saw the target tag was at the treeview level.
Robert Haken, MVP, provided this answer...

---000---

For all TreeView nodes, you can set

MyTreeView.Target = "_blank"; // or any other target

for only some of them, you can use the TreeNodeDataBound event:

protected void MyTreeView_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{
if( e.Node.NavigateUrl == "[url]" ) // get only this one item
e.Node.Target = "_blank"; // or any other target
}

---000---

re:
Does anyone have a work around for this Design Flaw?
Why do you consider that a "design flaw" ?

Which functionality do you think is missing ?


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ne*****@lni.wa.govwrote in message news:11*********************@i42g2000cwa.googlegro ups.com...
>I can't beleive that Microsoft would create the whole Sitemap XML
datasource process but not have a TARGET tag. What am I missing? The
only place I saw the target tag was at the treeview level. Please tell
me that something this basic is at the siteMapNode level and not the
Treeview level?
>
Does anyone have a work around for this Design Flaw?
>
Oct 14 '06 #4

P: n/a
Great!

Congratulations...
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ne*****@lni.wa.govwrote in message news:11**********************@m7g2000cwm.googlegro ups.com...
I got it to work.

Thanks for your help. This is how it ended up looking.
Protected Sub MyTreeView_TreeNodeDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) _
Handles TreeView1.TreeNodeDataBound

If e.Node.NavigateUrl.EndsWith("pdf") Then
e.Node.Target = "_blank"
End If
End Sub

ne*****@lni.wa.gov wrote:
Thank you for your time in responding to my query.
Here is an example how I figured it would work ... Note the "Target"
tag's on the url's that are PDF's
<siteMapNode title="Lakeridge - Home Page" description=""
url="LakeridgeWater.aspx">
<siteMapNode title="Articles of Incorporation" description=""
url="Articles.aspx" />
<siteMapNode title="Minutes for 2006" description="" >
<siteMapNode title="September 2006" description=""
url="minutes0912.pdf" target="_blank"/>
<siteMapNode title="August 2006" description=""
url="minutes0806.pdf" target="_blank" />
<siteMapNode title="July 20, 2006" description=""
url="minutes0720.pdf" target="_blank"/>
<siteMapNode title="July 11, 2006" description=""
url="minutes0711.pdf" target="_blank"/>
</siteMapNode>
<siteMapNode title="Bylaws" description="" url="bylaws.aspx" />
<siteMapNode title="Plot Map" description="" url="plotmap.aspx" />
</siteMapNode>
</siteMap>
I do not want it at the Treeview level. That means that all the
sitemapnodes will open up in a new window. I need to be able to pick
and choose what the target is.

I have some documents that are PDF documents, I need to open them up in
a new window so I do not loose the navagation.

I tried your sample code on my master page (I use vb not c#, sorry).
If I could get this to work, then I could set the e.Node.Target =
"_blank" if the url ends with "PDF". But, I could not get it to work.
It looks like you can overide the sitemap at databound time, but it
did not execute.

Protected Sub MyTreeView_TreeNodeDataBound(ByVal sender As Object,
ByVal e As TreeNodeEventArgs)
If e.Node.NavigateUrl = "[url]" Then
e.Node.Target = "_blank"
End If
End Sub
I put a breakpoint here but it did not stop on this subroutine. I put
this on the masterpage, is there somewhere else to put it?

Juan T. Llibre wrote:
re:
What am I missing? The only place I saw the target tag was at the treeview level.
Robert Haken, MVP, provided this answer...

---000---

For all TreeView nodes, you can set

MyTreeView.Target = "_blank"; // or any other target

for only some of them, you can use the TreeNodeDataBound event:

protected void MyTreeView_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{
if( e.Node.NavigateUrl == "[url]" ) // get only this one item
e.Node.Target = "_blank"; // or any other target
}

---000---

re:
Does anyone have a work around for this Design Flaw?
Why do you consider that a "design flaw" ?

Which functionality do you think is missing ?


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ne*****@lni.wa.govwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
>I can't beleive that Microsoft would create the whole Sitemap XML
datasource process but not have a TARGET tag. What am I missing? The
only place I saw the target tag was at the treeview level. Please tell
me that something this basic is at the siteMapNode level and not the
Treeview level?
>
Does anyone have a work around for this Design Flaw?
>

Oct 14 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.