Try
Normally, you would do this.
e.Item.ImageUrl = ((SiteMapNode) e.Item.DataItem).ImageUrl;
but the sitemapnode object doesn't have an ImageUrl property so I'm assuming
it's an attribute.
e.Item.ImageUrl = ((SiteMapNode) e.Item.DataItem).Attributes["ImageUrl"];
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
[quoted text, click to view] "Jeff" <it_consultant1@hotmail.com.NOSPAM> wrote in message
news:%23b1XGGtVHHA.1756@TK2MSFTNGP05.phx.gbl...
> Hmm, that gives me this error:
> System.Web.UI.WebControls.MenuItem.DataItem' is a 'property' but is used
> like a 'method'
>
>
>
> "Scott M." <s-mar@nospam.nospam> wrote in message
> news:Oi4hu$sVHHA.1208@TK2MSFTNGP03.phx.gbl...
>> e.Item.ImageUrl = (SiteMapNode) e.Item.DataItem("ImageUrl");
>>
>>
>>
>>
>> "Jeff" <it_consultant1@hotmail.com.NOSPAM> wrote in message
>> news:uWIfB9sVHHA.4828@TK2MSFTNGP05.phx.gbl...
>>> Dear reader!
>>>
>>> ASP.NET 2.0
>>>
>>> How should this line with vb.net code:
>>>
>>> be as C#?????
>>>
>>> I want to put the code into MenuItemDataBound(object sender,
>>> MenuEventArgs e)
>>> eventhandler.
>>>
>>> I came across this vb.net code on the web, but I'm programming in C# so
>>> I need to convert it into C# for to be able to use it
>>>
>>> Any suggestions?
>>>
>>> Jeff
>>>
>>
>>
>
>