html id not working in code behind

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    html id not working in code behind

    I am using VS 2008 and have an "id" on my "body" tag but I can't seem to
    access it from my code behind. Do I need an Imports of some kind to access
    or something else?

    In my .aspx page I have:

    <body id="myBody">

    and in my .aspx.vb I have:

    myBody.Attribut es.Add("onLoad" ,
    "document.f orms[0].SearchName.foc us()")

    With my imports:

    Option Strict On
    Imports System.Data
    Imports System.Data.Sql Client
    Imports MyFunctions.Bit Handling
    Imports System.Drawing
    Imports MyFunctions
    Imports RolesBasedAuthe ntication

    Am I missing something?

    Thanks,

    Tom


  • Mark Rae [MVP]

    #2
    Re: html id not working in code behind

    "tshad" <tfs@dslextreme .comwrote in message
    news:%23BRyvZTH JHA.3932@TK2MSF TNGP03.phx.gbl. ..
    >I am using VS 2008 and have an "id" on my "body" tag but I can't seem to
    >access it from my code behind. Do I need an Imports of some kind to access
    >or something else?
    Something else...
    Am I missing something?
    Yes.
    <body id="myBody">
    <body id="myBody" runat="server">


    --
    Mark Rae
    ASP.NET MVP


    Comment

    • tshad

      #3
      Re: html id not working in code behind


      "Mark Rae [MVP]" <mark@markNOSPA Mrae.netwrote in message
      news:uWYUT2VHJH A.1156@TK2MSFTN GP04.phx.gbl...
      "tshad" <tfs@dslextreme .comwrote in message
      news:%23BRyvZTH JHA.3932@TK2MSF TNGP03.phx.gbl. ..
      >
      >>I am using VS 2008 and have an "id" on my "body" tag but I can't seem to
      >>access it from my code behind. Do I need an Imports of some kind to
      >>access or something else?
      >
      Something else...
      >
      >Am I missing something?
      >
      Yes.
      >
      ><body id="myBody">
      >
      <body id="myBody" runat="server">
      Of course.

      Little mind fade there.

      I always added this to my body tag in the past and just forgot to add it
      when I put the id in.

      Thanks,

      Tom
      >
      >
      --
      Mark Rae
      ASP.NET MVP
      http://www.markrae.net

      Comment

      Working...