not getting clientid by using external js

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • svibuk
    New Member
    • Dec 2008
    • 8

    #1

    not getting clientid by using external js

    i have var mycontrol = <%=newcontrol.C lientId%>.id; in my aspx page
    and i have an external .js file
    but by uisng in this way i am not gettiing the clientid of the new control.
    can anybody help
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    how is the asp (server side) and the javascript (client side) connected?

    regards

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      You will most likely get an error with that code. The Client ID will be a string, but in JavaScript it will look like a variable name (which most likely doesn't exist), so add quotes around it:
      Code:
      var mycontrol = "<%=newcontrol.ClientId%>";

      Comment

      Working...