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