470,870 Members | 1,463 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

2.0: accessing control in DataList_Edit

Could you help me please?
I have:

<asp:DataList ID="MateriałyDataList" runat="server"
<asp:Label ID="NumerEdit" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "Numer" %>' />

And I try to access the asp:Label in Materiał_Edit():

proctected void Materiały_Edit(object sender, DataListCommandEventArgs e)
string Numer = ((Label)e.Item.FindControl("NumerEdit")).Text; // HERE

I have runtime error: FindControl returns null. I have checked: e.Item is a
DataListItem object with attibutes: DataItem=null, ItemIndex=0,
ItemType=Item. The problem occurs at each position of the asp:DataList.
DataBinding works correctly.
Could you help me?
Oct 10 '06 #1
0 885

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Vivek Sharma | last post: by
3 posts views Thread by AdamM | last post: by
1 post views Thread by Jeff Lynch | last post: by
6 posts views Thread by evandelagrammaticas | last post: by
reply views Thread by =?Utf-8?B?QmFyZW4=?= | last post: by
3 posts views Thread by Nathan Sokalski | last post: by
8 posts views Thread by GaryDean | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.