Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Databinding Syntax Not Working in ListView LayoutTemplate

Reply
Thread Tools

Databinding Syntax Not Working in ListView LayoutTemplate

 
 
Roshawn
Guest
Posts: n/a
 
      03-21-2008
Hi,

Working with the new ListView control seems pretty straightforward. For some reason,
using ASP.NET's databinding syntax (i.e. <%# DataHere %>) in the control's layouttemplate
doesn't work. Is there any way of making it work? If not, is it possible to create a
derived control that enables this functionality?

Thanks,
Roshawn
 
Reply With Quote
 
 
 
 
Stan
Guest
Posts: n/a
 
      03-21-2008
On 21 Mar, 16:43, Roshawn <(E-Mail Removed)> wrote:
> Hi,
>
> Working with the new ListView control seems pretty straightforward. *Forsome reason,
> using ASP.NET's databinding syntax (i.e. <%# DataHere %>) in the control'slayouttemplate
> doesn't work. *Is there any way of making it work? *If not, is it possible to create a
> derived control that enables this functionality?
>
> Thanks,
> Roshawn


You have to include the Eval("<column name>") or the Bind("<column
name>") function within the '<%# ... %> ' to actually retrieve or
ammend any data.

HTH
 
Reply With Quote
 
 
 
 
Roshawn
Guest
Posts: n/a
 
      03-21-2008
Thanks for the response. Unfortunately, even this doesn't work. From what I've read,
it's not possible to bind to anything within the ListView's layouttemplate. It's strange
that I can do so in a master page and pretty much anywhere else except here.

I'm open to any more suggestions.

Thanks,
RoshawnStan wrote:
> On 21 Mar, 16:43, Roshawn <(E-Mail Removed)> wrote:
>> Hi,
>>
>> Working with the new ListView control seems pretty straightforward. For some reason,
>> using ASP.NET's databinding syntax (i.e. <%# DataHere %>) in the control's layouttemplate
>> doesn't work. Is there any way of making it work? If not, is it possible to create a
>> derived control that enables this functionality?
>>
>> Thanks,
>> Roshawn

>
> You have to include the Eval("<column name>") or the Bind("<column
> name>") function within the '<%# ... %> ' to actually retrieve or
> ammend any data.
>
> HTH

 
Reply With Quote
 
Stan
Guest
Posts: n/a
 
      03-21-2008
On 21 Mar, 18:27, Roshawn <(E-Mail Removed)> wrote:
> Thanks for the response. *Unfortunately, even this doesn't work. *Fromwhat I've read,
> it's not possible to bind to anything within the ListView's layouttemplate.. *It's strange
> that I can do so in a master page and pretty much anywhere else except here.
>
> I'm open to any more suggestions.
>
> Thanks,
>
>
>
> RoshawnStan wrote:
> > On 21 Mar, 16:43, Roshawn <(E-Mail Removed)> wrote:
> >> Hi,

>
> >> Working with the new ListView control seems pretty straightforward. *For some reason,
> >> using ASP.NET's databinding syntax (i.e. <%# DataHere %>) in the control's layouttemplate
> >> doesn't work. *Is there any way of making it work? *If not, is it possible to create a
> >> derived control that enables this functionality?

>
> >> Thanks,
> >> Roshawn

>
> > You have to include the Eval("<column name>") or the Bind("<column
> > name>") function within the '<%# ... %> ' to actually retrieve or
> > ammend any data.

>
> > HTH- Hide quoted text -

>
> - Show quoted text -


Ahh! Sorry I misunderstood.

The answer to your question is probably no. The LayoutTemplate is
purely to define the overall structure and appearence of the control
not to render any actual data. All databound elements have to go in
the ItemTemplate, AlternatingItemtemplate etc

If you tell us a bit more about what you are trying to do it may be
possible to suggest alternatives.
 
Reply With Quote
 
Wallace Breza
Guest
Posts: n/a
 
      01-02-2009
You can subscribe to the "LayoutCreated" event within the
ListView control. Within the event handler, cast the
sender to the ListView, perform a FindControl(id) for the
control within the LayoutTemplate that you want to
manipulate and programatically databind your control(s).

*** Sent via Developersdex http://www.developersdex.com ***
 
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
asp.net ListView control - Configure ListView option missing? . ASP .Net 0 07-24-2010 12:20 AM
Intellisense does not present tags like <LayoutTemplate> mat ASP .Net 1 04-18-2009 08:11 PM
some databinding techniqes neede using in listview - mesut ASP .Net 3 08-12-2008 10:01 AM
Databinding Syntax Not Working in ListView LayoutTemplate Roshawn ASP .Net 0 03-21-2008 07:42 PM
Login Control LayoutTemplate Enter Key Event =?Utf-8?B?VHlsZXIgQ2FydmVy?= ASP .Net 1 02-07-2006 08:17 AM



Advertisments