Server control

  • Thread starter Thread starter simon
  • Start date Start date
S

simon

If I have:

<table>
<tr runat=server id=row1>
<td><asp:listbox runat=server id=lst1></asp:listBox></td>
</tr>
</table>

then I get that reference object has the value of nothing in code behind file:
Protected WithEvents lst1 As System.Web.UI.WebControls.ListBox

If I have

<table>
<tr>
<td><asp:listbox runat=server id=lst1></asp:listBox></td>
</tr>
</table>

than it works.

So I can't have one server control included in other, except if I use panel control?

Regards,S
 
And What about this :

Control c = row1.FindControl("lst1");
if(c != null)
{
ListBox lst1 = (ListBox)c;
}

Steve

"simon" <[email protected]> a écrit dans le message de (e-mail address removed)...
If I have:

<table>
<tr runat=server id=row1>
<td><asp:listbox runat=server id=lst1></asp:listBox></td>
</tr>
</table>

then I get that reference object has the value of nothing in code behind
file:
Protected WithEvents lst1 As System.Web.UI.WebControls.ListBox

If I have

<table>
<tr>
<td><asp:listbox runat=server id=lst1></asp:listBox></td>
</tr>
</table>

than it works.

So I can't have one server control included in other, except if I use panel
control?

Regards,S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top