Error : Response is not declared

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anni V
    New Member
    • Feb 2009
    • 22

    Error : Response is not declared

    Hi guys,
    I am facing a problem with the Code behind file of the ASP.NET file i.e.new.aspx.vb is not allowing me to access the properties of the HTML controls on the .aspx page the error is as follows
    My design code on the aspx page is
    Code:
    <table border = "0"; id = "tblecs" align ="center" style="width: 886px; height: 134px;" rules="none">
    But in the code behind page
    New.aspx.vb
    When I write
    Code:
    Partial Class New
        Inherits System.Web.UI.Page
     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     txtapptDate.Visible = False
            lblformat.Visible = False
            tblecs.Visible =False
    The error the compiler gives me is "tblecs is not declared" when actually it is an HTML control & generally is easily accessible from an Asp.net page.
    If anyone can help me out will be a lot more grateful to you, please rely to this asap.........

    Thanks ..........
    Ani
    Last edited by Frinavale; Mar 2 '09, 02:44 PM. Reason: Moved to ASP.NET answers from .NET and added [code] tags
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Try adding runat="server" to your <table>

    Comment

    • Anni V
      New Member
      • Feb 2009
      • 22

      #3
      ..

      ............... ........

      Comment

      • Anni V
        New Member
        • Feb 2009
        • 22

        #4
        Originally posted by Frinavale
        Try adding runat="server" to your <table>
        Thanks a lot buddy for the solution it did work
        ....Thank You

        Comment

        • kunal pawar
          Contributor
          • Oct 2007
          • 297

          #5
          Anni, you can not access HTML control from code behind untill you are not using runat property in that HTML Tag.

          Comment

          • Anni V
            New Member
            • Feb 2009
            • 22

            #6
            Thanks guys ,it worked I did'nt realize that
            thank you kunal for the solution
            regards;)

            Comment

            Working...