Hi,
I have got a User Control that contains for the sake of argument, a single
DataList control.
eg.
<asp:DataList id="DataList1" runat="server" RepeatDirection="Horizontal"
RepeatColumns="4"
Width="100%" GridLines="Vertical">
<ItemTemplate>
asdf
</ItemTemplate>
</asp:DataList>
VS.NET 2003 automatically puts in the code behind:
protected System.Web.UI.WebControls.DataList DataList1;
in the Page_Load event of the control, this.DataList1 is always undefined.
I've tried this again with other controls, created new really simple test
control to see if the same thing happens, and it does. I can't seem to be
able to get a reference to the Web Control held within the UserControl.
I must be missing something yeah?
Please help

Signature
TIA
Sam Martin
Steve C. Orr [MVP, MCSD] - 30 Mar 2006 20:03 GMT
Try changing the declaration from "protected" to "public".
Here's more info:
http://SteveOrr.net/faq/PassDataToUserControl.aspx

Signature
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
> Hi,
>
[quoted text clipped - 23 lines]
>
> Please help