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. master page

master page

Scheduled Pinned Locked Moved ASP.NET
questionjavatoolstutorial
8 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.
  • T Offline
    T Offline
    trilokharry
    wrote on last edited by
    #1

    I'm writing java script in aspx page(this is inheriting master page). this code to get value of TextBox1.Text : document.write(document.getElementById('<%=TextBox1.ClientID%>').value); now my question is : How to assign this value in TextBox2.text ? like this not working TextBox2.Text = document.getElementById('<%=TextBox1.ClientID%>').value; thanks in advance Harry

    You get the best out of others when you give the best of yourself.

    I N 2 Replies Last reply
    0
    • T trilokharry

      I'm writing java script in aspx page(this is inheriting master page). this code to get value of TextBox1.Text : document.write(document.getElementById('<%=TextBox1.ClientID%>').value); now my question is : How to assign this value in TextBox2.text ? like this not working TextBox2.Text = document.getElementById('<%=TextBox1.ClientID%>').value; thanks in advance Harry

      You get the best out of others when you give the best of yourself.

      I Offline
      I Offline
      imsathy
      wrote on last edited by
      #2

      var clientId = '<%=ClientID%>'; document.getElementById(ClientId + '_TextBox2').value = document.getElementById(ClientId + '_TextBox1').value; try this way ...

      Sathy

      T 1 Reply Last reply
      0
      • I imsathy

        var clientId = '<%=ClientID%>'; document.getElementById(ClientId + '_TextBox2').value = document.getElementById(ClientId + '_TextBox1').value; try this way ...

        Sathy

        T Offline
        T Offline
        trilokharry
        wrote on last edited by
        #3

        It's not working. document.getElementById(ClientId + '_TextBox2').value I think above code to get value not for assigning. I want to assign value in TextBox2. please tell me other way. thanks a lot to try to solve my problem.

        You get the best out of others when you give the best of yourself.

        I 1 Reply Last reply
        0
        • T trilokharry

          It's not working. document.getElementById(ClientId + '_TextBox2').value I think above code to get value not for assigning. I want to assign value in TextBox2. please tell me other way. thanks a lot to try to solve my problem.

          You get the best out of others when you give the best of yourself.

          I Offline
          I Offline
          imsathy
          wrote on last edited by
          #4

          Declare these things in master page var clientId = '<%=ClientID%>'; var contentId = '<%=ContentPlaceHolder1.ID %>'; var separator = '<%=IdSeparator%>'; Write this javascript code in your aspx page. document.getElementById(clientId +separator+ contentId + separator + 'TextBox2').value = document.getElementById(clientId +separator+ contentId + separator + 'TextBox1').value;

          Sathy

          T 1 Reply Last reply
          0
          • T trilokharry

            I'm writing java script in aspx page(this is inheriting master page). this code to get value of TextBox1.Text : document.write(document.getElementById('<%=TextBox1.ClientID%>').value); now my question is : How to assign this value in TextBox2.text ? like this not working TextBox2.Text = document.getElementById('<%=TextBox1.ClientID%>').value; thanks in advance Harry

            You get the best out of others when you give the best of yourself.

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

            document.getElementById('<%=TextBox2.ClientID%>').value = document.getElementById('<%=TextBox1.ClientID%>').value;

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            I 1 Reply Last reply
            0
            • N N a v a n e e t h

              document.getElementById('<%=TextBox2.ClientID%>').value = document.getElementById('<%=TextBox1.ClientID%>').value;

              All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

              I Offline
              I Offline
              imsathy
              wrote on last edited by
              #6

              this is not working!!!

              N a v a n e e t h wrote:

              document.getElementById('<%=TextBox2.ClientID%>').value = document.getElementById('<%=TextBox1.ClientID%>').value;

              but this works document.getElementById('<%=TextBox2.UniqueID%>').value = document.getElementById('<%=TextBox1.UniqueID%>').value; ClientID uses ClientIDSeparator property where masterpage uses IdSepartor property :~

              Sathy

              T 1 Reply Last reply
              0
              • I imsathy

                Declare these things in master page var clientId = '<%=ClientID%>'; var contentId = '<%=ContentPlaceHolder1.ID %>'; var separator = '<%=IdSeparator%>'; Write this javascript code in your aspx page. document.getElementById(clientId +separator+ contentId + separator + 'TextBox2').value = document.getElementById(clientId +separator+ contentId + separator + 'TextBox1').value;

                Sathy

                T Offline
                T Offline
                trilokharry
                wrote on last edited by
                #7

                Now working properly Thank you so much. I have one problem more. function ChangePage(id) { // save the page clicked document.all.PageNumber.value = id; // call the __doPostBack function to post back the form and execute the //PageClick event __doPostBack('PageClick',''); } document.all.PageNumber.value = id; code is not working. How to assign id into document.all.PageNumber.value thanks in advance.

                You get the best out of others when you give the best of yourself.

                1 Reply Last reply
                0
                • I imsathy

                  this is not working!!!

                  N a v a n e e t h wrote:

                  document.getElementById('<%=TextBox2.ClientID%>').value = document.getElementById('<%=TextBox1.ClientID%>').value;

                  but this works document.getElementById('<%=TextBox2.UniqueID%>').value = document.getElementById('<%=TextBox1.UniqueID%>').value; ClientID uses ClientIDSeparator property where masterpage uses IdSepartor property :~

                  Sathy

                  T Offline
                  T Offline
                  trilokharry
                  wrote on last edited by
                  #8

                  Now working properly Thank you so much. I have one problem more. function ChangePage(id) { // save the page clicked document.all.PageNumber.value = id; // call the __doPostBack function to post back the form and execute the //PageClick event __doPostBack('PageClick',''); } document.all.PageNumber.value = id; code is not working. How to assign id into document.all.PageNumber.value thanks in advance.

                  You get the best out of others when you give the best of yourself.

                  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