PC Review


Reply
Thread Tools Rate Thread

Container.DataItem

 
 
Mike P
Guest
Posts: n/a
 
      21st Mar 2005
I'm having trouble with C# syntax for Container.DataItem. This is the
VB version. CAn anybody help me out with the syntax?

<aspataList runat="server" id="dlResults"
Font-Name="Verdana" Font-Size="10pt">

<ItemTemplate>
<span style="font-size:15pt;font-weight:bold;">
<%# Container.DataItem.title %>
</span><br />
<%# Container.DataItem.snippet %><br />
[<a href="<%# Container.DataItem.URL %>"><%#
Container.DataItem.URL %></a>]
</ItemTemplate>

<SeparatorTemplate>
<p> </p>
</SeparatorTemplate>

</aspataList>

Any help would be really appreciated.


Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Ignacio Machin \( .NET/ C# MVP \)
Guest
Posts: n/a
 
      21st Mar 2005
HI Mike,

What is the type of the bounded collection?

Container.DataItem is an object for the instance being bounded, if it's a
datatable for example you could do like this
((DataRow)Container.DataItem)["ColumnName"]

or if it's a strong typed collection of some type you could do like this
((CollectionType)Container.DataItem).Property

hoe this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation




"Mike P" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm having trouble with C# syntax for Container.DataItem. This is the
> VB version. CAn anybody help me out with the syntax?
>
> <aspataList runat="server" id="dlResults"
> Font-Name="Verdana" Font-Size="10pt">
>
> <ItemTemplate>
> <span style="font-size:15pt;font-weight:bold;">
> <%# Container.DataItem.title %>
> </span><br />
> <%# Container.DataItem.snippet %><br />
> [<a href="<%# Container.DataItem.URL %>"><%#
> Container.DataItem.URL %></a>]
> </ItemTemplate>
>
> <SeparatorTemplate>
> <p> </p>
> </SeparatorTemplate>
>
> </aspataList>
>
> Any help would be really appreciated.
>
>
> Cheers,
>
> Mike
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Container.DataItem rn5a@rediffmail.com Microsoft ASP .NET 6 24th Sep 2007 06:49 PM
<%# ((DataBinder.Eval(Container.DataItem, "SourceAddress").ToString().ToLowerInvariant() != Rd.UserAddress.ToLowerInvariant()) ? "" : "<a href='AddRelationNote.aspx?Id=" + DataBinder.Eval(Container.DataItem, " savisss@gmail.com Windows XP Internet Explorer 0 12th Mar 2007 02:27 PM
Container.DataItem rn5a@rediffmail.com Microsoft ASP .NET 4 1st Oct 2006 10:46 AM
'Container.DataItem' is not declared Antony Microsoft ASP .NET 2 26th Dec 2005 04:48 PM
Container.dataitem ? =?Utf-8?B?QmVuIFIu?= Microsoft ASP .NET 4 1st Nov 2004 03:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:12 PM.