HTML Server Controls!

  • Thread starter Thread starter Adam Knight
  • Start date Start date
A

Adam Knight

Hi All,

I am finding in VS that i can't access properties of HTML Server Controls
from within my code behind file.

Can anyone tell me is this normal?
How do i reference HTML Server Controls from within my code behind file?

Cheers,
Adam
 
To Clarify,

<table ID="UpdteForm" Runat="server" border="0" width="350">
<tr runat="server">
<td runat="server" align="right"><asp:TextBox ID="txtName" Width="200"
Runat="server"></asp:TextBox></td>
<td runat="server" align="right" width="120">
<asp:Button ID="btnUpdate" Runat="server" Text="update"/>
<asp:Button ID="btnCancel" Runat="server" Text="cancel"/>
</td>
<td runat="server" align="right" width="30">
<asp:Button ID="btnSave" Runat="server" Text="save"/>
</td>
</tr>
</table>

In Page_Load Method in my code behind:

When i try to refer to 'UpdteForm.?.?' a message is issued saying
'UpdteForm' hasn't been declared.

Cheers,
AK
 
You have to add a declaration for the HTML table in the code behind file:

Protected UpdteForm as System.Web.UI.HtmlControls.HtmlTable
 
Back
Top