HTML Server Controls!

Discussion in 'ASP .Net' started by Adam Knight, Jul 26, 2005.

  1. Adam Knight

    Adam Knight Guest

    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
     
    Adam Knight, Jul 26, 2005
    #1
    1. Advertising

  2. Adam Knight

    Adam Knight Guest

    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
     
    Adam Knight, Jul 26, 2005
    #2
    1. Advertising

  3. You have to add a declaration for the HTML table in the code behind file:

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

    "Adam Knight" wrote:

    > 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
    >
    >
    >
     
    =?Utf-8?B?TWU=?=, Sep 7, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden
    Replies:
    1
    Views:
    6,963
    Scott M.
    Oct 11, 2003
  2. =?Utf-8?B?c2lhag==?=
    Replies:
    7
    Views:
    1,500
    =?Utf-8?B?c2lhag==?=
    Mar 7, 2005
  3. =?Utf-8?B?Q2hyaXMgRGF2b2xp?=

    HTML controls instead of .Net server controls

    =?Utf-8?B?Q2hyaXMgRGF2b2xp?=, Sep 16, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    553
    Jay Pondy
    Sep 16, 2006
  4. Nathan Sokalski
    Replies:
    4
    Views:
    1,153
    Muhammad Naveed Yaseen
    Sep 5, 2007
  5. brian

    HTML Server Controls vs Web Server Controls

    brian, Jan 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    312
    Steve C. Orr [MVP, MCSD]
    Jan 24, 2005
Loading...

Share This Page