Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to get clientid of asp.net textbox

How to get clientid of asp.net textbox

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nethelptutorial
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Deepak Nigam
    wrote on last edited by
    #1

    Hello friends In my app i have ti transfer some text from one textbox to another textbox. for that i want to retriev the element by its ClientID but how to get it my JS file. Please help me............

    Deepak Nigam

    V C A 3 Replies Last reply
    0
    • D Deepak Nigam

      Hello friends In my app i have ti transfer some text from one textbox to another textbox. for that i want to retriev the element by its ClientID but how to get it my JS file. Please help me............

      Deepak Nigam

      V Offline
      V Offline
      Vijayitsb
      wrote on last edited by
      #2

      You can get it from Browser's View source

      Thank& Regards Vijay s

      1 Reply Last reply
      0
      • D Deepak Nigam

        Hello friends In my app i have ti transfer some text from one textbox to another textbox. for that i want to retriev the element by its ClientID but how to get it my JS file. Please help me............

        Deepak Nigam

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Use the ClientID property of the control on the server side, and inject it as javascript so that you have a variable that contains that value, on the client side.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        • D Deepak Nigam

          Hello friends In my app i have ti transfer some text from one textbox to another textbox. for that i want to retriev the element by its ClientID but how to get it my JS file. Please help me............

          Deepak Nigam

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          Read Client ID var txtTextBox="<%=txtMyTextBox.ClientID %>"; Get Value From This var myValue=document.GetElementByID("txtTextBox");

          Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

          A 1 Reply Last reply
          0
          • A Abhijit Jana

            Read Client ID var txtTextBox="<%=txtMyTextBox.ClientID %>"; Get Value From This var myValue=document.GetElementByID("txtTextBox");

            Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

            A Offline
            A Offline
            Ashish Sehajpal
            wrote on last edited by
            #5

            exact approach dear but use var myValue=document.getElementByID(txtTextBox); instead of var myValue=document.GetElementByID("txtTextBox"); or we can save a variable by using var myValue=document.getElementByID("<%=txtMyTextBox.ClientID %>");

            Ashish Sehajpal

            modified on Wednesday, April 9, 2008 4:12 AM

            A C 2 Replies Last reply
            0
            • A Ashish Sehajpal

              exact approach dear but use var myValue=document.getElementByID(txtTextBox); instead of var myValue=document.GetElementByID("txtTextBox"); or we can save a variable by using var myValue=document.getElementByID("<%=txtMyTextBox.ClientID %>");

              Ashish Sehajpal

              modified on Wednesday, April 9, 2008 4:12 AM

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #6

              ;)

              Best Regards ----------------- Abhijit Jana Microsoft Certified Professional "Success is Journey it's not a destination"

              1 Reply Last reply
              0
              • A Ashish Sehajpal

                exact approach dear but use var myValue=document.getElementByID(txtTextBox); instead of var myValue=document.GetElementByID("txtTextBox"); or we can save a variable by using var myValue=document.getElementByID("<%=txtMyTextBox.ClientID %>");

                Ashish Sehajpal

                modified on Wednesday, April 9, 2008 4:12 AM

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                Ashish Sehajpal wrote:

                but use var myValue=document.getElementByID("txtTextBox"); instead of var myValue=document.GetElementByID("txtTextBox");

                LOL - I think you meant to remove the quotes there somewhere.

                Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                A 1 Reply Last reply
                0
                • C Christian Graus

                  Ashish Sehajpal wrote:

                  but use var myValue=document.getElementByID("txtTextBox"); instead of var myValue=document.GetElementByID("txtTextBox");

                  LOL - I think you meant to remove the quotes there somewhere.

                  Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                  A Offline
                  A Offline
                  Ashish Sehajpal
                  wrote on last edited by
                  #8

                  :-\ even u have not noticed the SYNTAX of function dear..... :D

                  Ashish Sehajpal

                  C 1 Reply Last reply
                  0
                  • A Ashish Sehajpal

                    :-\ even u have not noticed the SYNTAX of function dear..... :D

                    Ashish Sehajpal

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #9

                    Oh, I see. Yes, the G needed to be a g, AND the name needed not to be in quotes, so as to use the variable that was being declared.

                    Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups