Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > repeater eval problem

Reply
Thread Tools

repeater eval problem

 
 
André Freitas
Guest
Posts: n/a
 
      01-13-2010
I got a repeater like this:

<asp:Repeater id="ParentRepeater" runat="server"
OnItemDataBound="OnItemDataBound">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
<ItemTemplate>
<li><b><%# Eval("imagem") %></b></li>
</ItemTemplate>
</asp:Repeater>

The designers will work the css and html page, its why im hoping for
something like this:

<ItemTemplate>
<li><b> <asp:label ???> </b></li>
</ItemTemplate>

Without any .net code in aspx page. How can i put the corret value in the
label?

Regards,
André


 
Reply With Quote
 
 
 
 
André Freitas
Guest
Posts: n/a
 
      01-14-2010
Yes, im using:

rptParent.DataSource = obj;
rptParent.DataBind();

And i do like the aspx page without any cs code (eval). Is it possible to be
done in the .cs page?

Sorry about poor english.
André


"Mark Rae [MVP]" <> escreveu na mensagem
news:...
> "André Freitas" <andrefreitas> wrote in message
> news:...
>
>> Without any .net code in aspx page.

>
> What does that actually mean?
>
> Are you trying to use a Repeater without any server-side code to bind the
> data to it?
>
> Are you using one of the DataSource controls...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
 
 
 
 
André Freitas
Guest
Posts: n/a
 
      01-15-2010
<asp:Repeater id="ParentRepeater" runat="server"
OnItemDataBound="OnItemDataBound">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
<ItemTemplate>
<li>###</li>
</ItemTemplate>
</asp:Repeater>

I dont want to bind it using eval in the aspx page. I do prefer to inject
the correct value using some code (?) in the .cs page. Is it possible? Is it
possible to bind without using the default way, the eval line?

Thx anyway,
Regards,
André


"Mark Rae [MVP]" <> escreveu na mensagem
news:...
> "André Freitas" <andrefreitas> wrote in message
> news:...
>
> [please don't top-post]
>
>>>> Without any .net code in aspx page.
>>>
>>> What does that actually mean?
>>>
>>> Are you trying to use a Repeater without any server-side code to bind
>>> the data to it?
>>>
>>> Are you using one of the DataSource controls...?

>>
>> Yes, im using:
>>
>> rptParent.DataSource = obj;
>> rptParent.DataBind();

>
> OK, so you're *not* using DataSource controls - that's fine...
>
> However, I'm struggling to see what the problem is... Eval is the standard
> way of using the Repeater control. See the following MSDN article:
> http://msdn.microsoft.com/en-us/magazine/cc163780.aspx
>
> The way you're doing it seems fine to me...
>
>
>> And I do like the aspx page without any cs code (eval). Is it possible to
>> be done in the .cs page?

>
> Typically, server-side code will reside in separate class files, though
> you can use inline coding if you want to - it's a personal preference...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
to eval or not to eval? Marc Girod Perl Misc 2 04-19-2011 01:13 PM
eval('07') works, eval('08') fails, why? Alex van der Spek Python 6 01-08-2009 08:24 PM
Different behavior between eval "07" and eval "08" Liang Wang Perl Misc 8 02-02-2008 08:31 PM
DataBinder.Eval and Eval. craigkenisston@hotmail.com ASP .Net 1 06-16-2006 05:33 PM
DataBinder.Eval for an object's property property... like Eval(Container.DataItem,"Version.Major") Eric Newton ASP .Net 3 04-04-2005 10:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57