How to change default values of autogenerated client id ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shashi adsure
    New Member
    • Feb 2011
    • 2

    How to change default values of autogenerated client id ?

    How to change default values of autogenerated client id ? In my code values are coming like ctrl_10 and want it to come as ctrl_100
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You don't :)

    If we examine Why you want to change the default ClientIDs for a control maybe we can come up with a solution that addresses the real issue that you're facing.

    -Frinny

    Comment

    • shashi adsure
      New Member
      • Feb 2011
      • 2

      #3
      Hi ,
      I have to run code developed on some other machine , on my machine .
      However due to different client ID values on different machines , i always face the issue

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Oh wait a sec.

        Do you realize that ASP.NET web controls have a ClientID Property?

        This means that you can access the client id of the control from your VB.NET or C# code.

        You can then use that to pass the client ids of the HTML controls into JavaScript methods...or you can use Response.Write( myControl.Clien tID) to directly insert the client id into the JavaScript.

        Check out this article on How to use JavaScript in ASP.NET for a quick overview of what I'm talking about :)

        -Frinny

        Comment

        Working...