I'm dynamically creating a SiteMap and I'd like to be able to open a URL in a new window (target='_blank') but I can't seem to find the place to do so. Does anyone know how this can be done instead of putting Javascript inside the URL to open a new window?
Here's part of my code to make the SiteMap:
public override SiteMapNode BuildSiteMap()
{
// Since the class is exposed to multiple pages,
// use locking to make sure that the site map is not rebuilt by more than one
// page at the same time.
lock (this)
{
// Start with a clean slate.
Clear();
// Get the results in a DataSet
DataSet ds = new DataSet();
ds = SiteData.UserInformation.Instance.GetMenuOptions();
DataTable dtSiteMap = ds.Tables["MenuOptions"];
// Get the root node.
DataRow rowRoot = dtSiteMap.Select("ParentID IS NULL")[0];
rootNode = new SiteMapNode(this,
rowRoot["URL"].ToString(), rowRoot["URL"].ToString(),
rowRoot["Title"].ToString(), rowRoot["Description"].ToString());
string rootID = rowRoot["MenuOptionID"].ToString();
// Fill down the hierarchy.
AddChildren(rootNode, rootID, dtSiteMap);
}
return rootNode;
}
Here's part of my code to make the SiteMap:
public override SiteMapNode BuildSiteMap()
{
// Since the class is exposed to multiple pages,
// use locking to make sure that the site map is not rebuilt by more than one
// page at the same time.
lock (this)
{
// Start with a clean slate.
Clear();
// Get the results in a DataSet
DataSet ds = new DataSet();
ds = SiteData.UserInformation.Instance.GetMenuOptions();
DataTable dtSiteMap = ds.Tables["MenuOptions"];
// Get the root node.
DataRow rowRoot = dtSiteMap.Select("ParentID IS NULL")[0];
rootNode = new SiteMapNode(this,
rowRoot["URL"].ToString(), rowRoot["URL"].ToString(),
rowRoot["Title"].ToString(), rowRoot["Description"].ToString());
string rootID = rowRoot["MenuOptionID"].ToString();
// Fill down the hierarchy.
AddChildren(rootNode, rootID, dtSiteMap);
}
return rootNode;
}