Z
zb
Scenario:
I have a datalist control bound to a datasource. By itself, this works
just fine. Now, inside the ItemTemplate I have a custom user control (I
wrote this user control) and it has an itemId property exposed so I can
assign this Id based on which it process other info.
How implemented: <ucrocessItem id="ucProcess" itemId="32e43432"
runat=server />
Inside the parent repeater control this is what I am doing:
<ucrocessItem id="ucProcess" itemId="<%#
DataBinder.Eval(Container.DataItem, "itemId") %>" runat=server />
And, this throws an error that tag is not well formed. What I want to
do is assign my user control's itemid value from the datasource of the
parent datalist. How do I do this?
I rather avoid this solution but I am open to using the ItemDataBound
event handler of the datalist and do the processing here. I tried this
and I could not figure out how to get the container data item. So, if
you have a code that can explain this to me will be very appreciated.
Thanks in advance.
I have a datalist control bound to a datasource. By itself, this works
just fine. Now, inside the ItemTemplate I have a custom user control (I
wrote this user control) and it has an itemId property exposed so I can
assign this Id based on which it process other info.
How implemented: <ucrocessItem id="ucProcess" itemId="32e43432"
runat=server />
Inside the parent repeater control this is what I am doing:
<ucrocessItem id="ucProcess" itemId="<%#
DataBinder.Eval(Container.DataItem, "itemId") %>" runat=server />
And, this throws an error that tag is not well formed. What I want to
do is assign my user control's itemid value from the datasource of the
parent datalist. How do I do this?
I rather avoid this solution but I am open to using the ItemDataBound
event handler of the datalist and do the processing here. I tried this
and I could not figure out how to get the container data item. So, if
you have a code that can explain this to me will be very appreciated.
Thanks in advance.