DixieFlatline
Programmer
Hi,
Using the example provide by Microsoft, I created a a databound template control that iterates through a custom collection. When I test this control using an aspx, I can see the the control is iterating. I can see the format I put into the template being generated i times for i equals the size of the collection. But when I try to access the dataitem, nothing gets printed...
<mypackage:mycontrol .... >
<mytemplate>
<b> <%# Container.DataItem.MyString%> </b>
</mytemplate>
</mypackage:mycontrol>
I can see that <b> </b> showing up 8 times on the generated html page. But MyString is no where to be found! I tried just printing it out as I have done above, setting it to a label.... nothing works. I check the code and I did remember to set DataItem for each iteration and I did remember to add each Item to the Control collection... what am I doing wrong!! Has anyone successfully build a databound control? any help would be greatly apprietiated. I am sure I am just forgetting something silly!
Dix
Using the example provide by Microsoft, I created a a databound template control that iterates through a custom collection. When I test this control using an aspx, I can see the the control is iterating. I can see the format I put into the template being generated i times for i equals the size of the collection. But when I try to access the dataitem, nothing gets printed...
<mypackage:mycontrol .... >
<mytemplate>
<b> <%# Container.DataItem.MyString%> </b>
</mytemplate>
</mypackage:mycontrol>
I can see that <b> </b> showing up 8 times on the generated html page. But MyString is no where to be found! I tried just printing it out as I have done above, setting it to a label.... nothing works. I check the code and I did remember to set DataItem for each iteration and I did remember to add each Item to the Control collection... what am I doing wrong!! Has anyone successfully build a databound control? any help would be greatly apprietiated. I am sure I am just forgetting something silly!
Dix