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. Get Clientid

Get Clientid

Scheduled Pinned Locked Moved ASP.NET
csharphtmlxmlquestion
6 Posts 3 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.
  • S Offline
    S Offline
    saravanan05
    wrote on last edited by
    #1

    hi to all how can i get the client id in .net html source: <input type="button" id="button1" class="buttonsT" name="inputval30something^&()%#@!sabs" value="30 Something(1494)" title="Click this Button to log in as 30 Something(1494)" onclick="loginas('30something^&()%#@!sabs');"> this entirly bind in xslt..not in html

    Known Is Drop.Unknown Is Ocean

    A 1 Reply Last reply
    0
    • S saravanan05

      hi to all how can i get the client id in .net html source: <input type="button" id="button1" class="buttonsT" name="inputval30something^&()%#@!sabs" value="30 Something(1494)" title="Click this Button to log in as 30 Something(1494)" onclick="loginas('30something^&()%#@!sabs');"> this entirly bind in xslt..not in html

      Known Is Drop.Unknown Is Ocean

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

      saravanan05 wrote:

      how can i get the client id in .net

      var id= document.getElementById(button1);

      cheers, Abhijit CodeProject MVP

      S 1 Reply Last reply
      0
      • A Abhijit Jana

        saravanan05 wrote:

        how can i get the client id in .net

        var id= document.getElementById(button1);

        cheers, Abhijit CodeProject MVP

        S Offline
        S Offline
        saravanan05
        wrote on last edited by
        #3

        hi thanks for reply hidden field: <input name="hd1" id="hd1" type="hidden" /> jsscript: function test() { // document.forms.tstformfortavern.hd1.value=document.getElementById("button1"); document.getElementById("hd1").value=document.getElementById("button1").id; alert(document.getElementById("hd1").value); } i try get value in hdn.value in codebehind.but i didnt get value rs sara

        Known Is Drop.Unknown Is Ocean

        N A 2 Replies Last reply
        0
        • S saravanan05

          hi thanks for reply hidden field: <input name="hd1" id="hd1" type="hidden" /> jsscript: function test() { // document.forms.tstformfortavern.hd1.value=document.getElementById("button1"); document.getElementById("hd1").value=document.getElementById("button1").id; alert(document.getElementById("hd1").value); } i try get value in hdn.value in codebehind.but i didnt get value rs sara

          Known Is Drop.Unknown Is Ocean

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          saravanan05 wrote:

          i try get value in hdn.value in codebehind.but i didnt get value

          What is hdn? Do you mean hd1? Your control is not marked as runat=server and how are you expecting to read it's value from code behind? :)

          Navaneeth How to use google | Ask smart questions

          1 Reply Last reply
          0
          • S saravanan05

            hi thanks for reply hidden field: <input name="hd1" id="hd1" type="hidden" /> jsscript: function test() { // document.forms.tstformfortavern.hd1.value=document.getElementById("button1"); document.getElementById("hd1").value=document.getElementById("button1").id; alert(document.getElementById("hd1").value); } i try get value in hdn.value in codebehind.but i didnt get value rs sara

            Known Is Drop.Unknown Is Ocean

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

            Make Hidden Field as Server Side Control Here is the java script script language="javascript" type="text/javascript"> var hdnid="<%= hdn.ClientID%>" function test() { var v= document.getElementById('btn1'); document.getElementById(hdnid).Value =v.value; alert( document.getElementById(hdnid).Value); } Now you can use hdn.value in codebehind also. cheers, Abhijit CodeProject MVP

            S 1 Reply Last reply
            0
            • A Abhijit Jana

              Make Hidden Field as Server Side Control Here is the java script script language="javascript" type="text/javascript"> var hdnid="<%= hdn.ClientID%>" function test() { var v= document.getElementById('btn1'); document.getElementById(hdnid).Value =v.value; alert( document.getElementById(hdnid).Value); } Now you can use hdn.value in codebehind also. cheers, Abhijit CodeProject MVP

              S Offline
              S Offline
              saravanan05
              wrote on last edited by
              #6

              thanks for reply Abhijit For example: i get client id button1 in codebehind I need to set button back color using this button1 id.. Is this possible?

              Known Is Drop.Unknown Is Ocean

              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