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. Passing data from one .aspx page to another .aspx page

Passing data from one .aspx page to another .aspx page

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

    Hi, I have two forms say Default.aspx and popup.aspx Default.aspx cotains a textbox whereas popup.aspx contains a text area. When user enters more than 10 characters in a textbox of default.aspx,popup.aspx should open and all characters of text box should get transfer to textarea of popup.aspx. The code that i had written using javascript is as follows: function limitText(){ var textboxvalue = document.getElementById("limitedtext").value; if(textboxvalue.length == 10) { alert(textboxvalue); window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200") } } And This is textbox code: ******Retrieving value in popup.aspx******** Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim strQuery As String = "" strQuery = Request.QueryString("value").ToString() TextArea1.Value = strQuery End Sub But When i put break point and check the value of strQuery, it is showing "textboxvalue" instead of characters typed in the textbox. I will be very grateful if you tell me that how should i pass the value through the url from the line: window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200") Thanks Shyam :(

    M S 2 Replies Last reply
    0
    • S shyamts

      Hi, I have two forms say Default.aspx and popup.aspx Default.aspx cotains a textbox whereas popup.aspx contains a text area. When user enters more than 10 characters in a textbox of default.aspx,popup.aspx should open and all characters of text box should get transfer to textarea of popup.aspx. The code that i had written using javascript is as follows: function limitText(){ var textboxvalue = document.getElementById("limitedtext").value; if(textboxvalue.length == 10) { alert(textboxvalue); window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200") } } And This is textbox code: ******Retrieving value in popup.aspx******** Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim strQuery As String = "" strQuery = Request.QueryString("value").ToString() TextArea1.Value = strQuery End Sub But When i put break point and check the value of strQuery, it is showing "textboxvalue" instead of characters typed in the textbox. I will be very grateful if you tell me that how should i pass the value through the url from the line: window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200") Thanks Shyam :(

      M Offline
      M Offline
      Mayank Parmar
      wrote on last edited by
      #2

      But When i put break point and check the value of strQuery, it is showing "textboxvalue" instead of characters typed in the textbox. Because you are the biggest fool in this community. Try this -- function limitText(){ var textboxvalue = document.getElementById("limitedtext").value; if(textboxvalue.length == 10) { alert(textboxvalue); var link = "popup.aspx?value=" + textboxvalue; window.open(link,"","resizable=1,width=600,height=200") } }

      Regards, Mayank Parmar Senior Software Engineer Amba Tech Gandhinagar, India

      1 Reply Last reply
      0
      • S shyamts

        Hi, I have two forms say Default.aspx and popup.aspx Default.aspx cotains a textbox whereas popup.aspx contains a text area. When user enters more than 10 characters in a textbox of default.aspx,popup.aspx should open and all characters of text box should get transfer to textarea of popup.aspx. The code that i had written using javascript is as follows: function limitText(){ var textboxvalue = document.getElementById("limitedtext").value; if(textboxvalue.length == 10) { alert(textboxvalue); window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200") } } And This is textbox code: ******Retrieving value in popup.aspx******** Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim strQuery As String = "" strQuery = Request.QueryString("value").ToString() TextArea1.Value = strQuery End Sub But When i put break point and check the value of strQuery, it is showing "textboxvalue" instead of characters typed in the textbox. I will be very grateful if you tell me that how should i pass the value through the url from the line: window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200") Thanks Shyam :(

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        shyamts wrote:

        window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200")

        the problem is here itself you are passing textboxvalue as a string not passing its value try this indow.open("popup.aspx?value="&textboxvalue.value&","","resizable=1,width=600,height=200"); or use +

        Thanks and Regards Sandeep If you want something you never had, do something you have never done!

        C 1 Reply Last reply
        0
        • S Sandeep Akhare

          shyamts wrote:

          window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200")

          the problem is here itself you are passing textboxvalue as a string not passing its value try this indow.open("popup.aspx?value="&textboxvalue.value&","","resizable=1,width=600,height=200"); or use +

          Thanks and Regards Sandeep If you want something you never had, do something you have never done!

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          Be careful - Depending on what the value is this can be a major security hole as it can easily be changed by the user.


          Upcoming events: * Glasgow: Introduction to AJAX (2nd May), SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

          S G 2 Replies Last reply
          0
          • C Colin Angus Mackay

            Be careful - Depending on what the value is this can be a major security hole as it can easily be changed by the user.


            Upcoming events: * Glasgow: Introduction to AJAX (2nd May), SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            Yes Colin Yes you are absolutely right but we don’t know for his application user have security as an issue or not. I showed only where he was wrong. But any way thanks for suggestion :)

            Thanks and Regards Sandeep If you want something you never had, do something you have never done!

            1 Reply Last reply
            0
            • C Colin Angus Mackay

              Be careful - Depending on what the value is this can be a major security hole as it can easily be changed by the user.


              Upcoming events: * Glasgow: Introduction to AJAX (2nd May), SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              Yes, but that is true for any value that you get from the request. Input is evil.[^]

              --- single minded; short sighted; long gone;

              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