hi,
i'm programattically creating a datalist and rendering it to the page via a
htmltextwriter.
i want to supply the itemtemplate at runtime but don't know how to do this.
i read the help at ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemWe
bUIITemplateClassTopic.htm
but i don't understand how that translates from what i'm familiar with in te
rms of a html template.. e.g:
<table><tr><td><% Container.DataItem %></td></tr></table>
is there some way to just use a string? i'm probably being too simplistic.
thanks for any help
tim
\\ email: tim at mackey dot ie //
\\ blog: http://tim.mackey.ie //
67d0ebfec70e8db3Hi Tim:
One easy way to do this is to create the templates as user controls
and bind them dynamically.
http://msdn.microsoft.com/library/d...UserControl.asp
There is also a programmatic approach:
http://msdn.microsoft.com/library/d...a
lly.asp
HTH,
Scott
http://www.OdeToCode.com/
On Sun, 10 Oct 2004 12:18:31 +0100, "Tim Mackey" <tim@.scootasp.net>
wrote:
>hi,
>i'm programattically creating a datalist and rendering it to the page via a
htmltextwriter.
>i want to supply the itemtemplate at runtime but don't know how to do this.
>i read the help at ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemW
ebUIITemplateClassTopic.htm
>but i don't understand how that translates from what i'm familiar with in t
erms of a html template.. e.g:
><table><tr><td><% Container.DataItem %></td></tr></table>
>is there some way to just use a string? i'm probably being too simplistic.
>thanks for any help
>tim
>
>\\ email: tim at mackey dot ie //
>\\ blog: http://tim.mackey.ie //
>67d0ebfec70e8db3
hi Scott,
many thanks for the reply.
this is very helpful.
tim
"Scott Allen" <bitmask@.[nospam].fred.net> wrote in message
news:kfhim0h6u1soa0t8pvfnjeld55djf9ltao@.
4ax.com...
> Hi Tim:
> One easy way to do this is to create the templates as user controls
> and bind them dynamically.
> http://msdn.microsoft.com/library/d...UserControl.asp
> There is also a programmatic approach:
> http://msdn.microsoft.com/library/d...br />
cally.asp
> HTH,
> --
> Scott
> http://www.OdeToCode.com/
> On Sun, 10 Oct 2004 12:18:31 +0100, "Tim Mackey" <tim@.scootasp.net>
> wrote:
>
>
Thursday, March 22, 2012
supply itemtemplate for datalist at runtime
Labels:
asp,
creating,
datalist,
htmltextwriter,
itemtemplate,
net,
page,
programattically,
rendering,
runtime,
supply,
via
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment