Wheres the Target for siteMapNode?

N

nesr235

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?
 
J

Juan T. Llibre

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 == "" ) // 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 ?
 
N

nesr235

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 = "" 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?


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 ?





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?
 
N

nesr235

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



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 = "" 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?


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 ?





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?
http://" Then e.Node.Target = "_bla...or this Design Flaw? [/QUOTE][/QUOTE][/QUOTE][/QUOTE]
 
J

Juan T. Llibre

Great!

Congratulations...



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



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 = "" 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?


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 ?





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?
http://" Then e.Node.Target = "_bla...or this Design Flaw? [/QUOTE][/QUOTE][/QUOTE][/QUOTE]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top