Link to home
Start Free TrialLog in
Avatar of Seven price
Seven priceFlag for United States of America

asked on

sitemapnode

Can you add a onclick function  in vb to a sitemapnode for each url
Avatar of kris_per
kris_per


Not sure if onclick function can be added to SiteMapNode....

But see if you can use SiteMapResolve event in code-behind for your requirement...

Avatar of Molnár István
i have found some code on this site: http://forums.asp.net/p/1404810/3068147.aspx

hope it helps
Avatar of Seven price

ASKER

I seen that but i need vb version? I will try to convert it again but did not work out correctly.
protected void SiteMapPath1_ItemCreated(object sender, SiteMapNodeItemEventArgs e)
    {        
if ((this.MasterJS != string.Empty) && (e.Item.ItemType !=
     SiteMapNodeItemType.PathSeparator) &&
(e.Item.ItemType != SiteMapNodeItemType.Current)
        {
            e.Item.Attributes.Add("onclick", this.MasterJS);
        }
else if (e.Item.ItemType == SiteMapNodeItemType.Current)
        {
            e.Item.Attributes.Add("onClick", "JavaScript: return false;");
        }

    }

can you convert this to vb, i need a class definitions and I do not know it for the above code.
ASKER CERTIFIED SOLUTION
Avatar of Molnár István
Molnár István
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I know the tool did not work for me, kept getting errors usually . Thanks
tks