javascript getElementById

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?cm9kY2hhcg==?=

    javascript getElementById

    hey all,

    Label1 is a bound control inside a TableCell

    var x = document.getEle mentById('Label 1')

    i want to suffix the Label1 control with another Label control inside the
    same TableCell. Can someone please tell me the best way to do this?

    thanks,
    rodchar
  • Alexey Smirnov

    #2
    Re: javascript getElementById

    On Jun 9, 4:32 pm, rodchar <rodc...@discus sions.microsoft .comwrote:
    hey all,
    >
    Label1 is a bound control inside a TableCell
    >
    var x = document.getEle mentById('Label 1')
    >
    i want to suffix the Label1 control with another Label control inside the
    same TableCell. Can someone please tell me the best way to do this?
    >
    thanks,
    rodchar
    You cannot use 'Label1', because .NET rendering engine automatically
    generates another identification for a control. To get the client id
    of the server control, use Control.ClientI D Property.

    e.g.

    var x = document.getEle mentById('<%Lab el1.ClientID%>' )


    Comment

    • =?Utf-8?B?cm9kY2hhcg==?=

      #3
      Re: javascript getElementById

      thanks for the tip,
      rod.

      "Alexey Smirnov" wrote:
      On Jun 9, 4:32 pm, rodchar <rodc...@discus sions.microsoft .comwrote:
      hey all,

      Label1 is a bound control inside a TableCell

      var x = document.getEle mentById('Label 1')

      i want to suffix the Label1 control with another Label control inside the
      same TableCell. Can someone please tell me the best way to do this?

      thanks,
      rodchar
      >
      You cannot use 'Label1', because .NET rendering engine automatically
      generates another identification for a control. To get the client id
      of the server control, use Control.ClientI D Property.
      >
      e.g.
      >
      var x = document.getEle mentById('<%Lab el1.ClientID%>' )
      >

      >

      Comment

      Working...