0

i created one web form

the form contain two label box and text box

in the form one button is placed

i click the button the page redirect to next page

window.location.href="fdfgd.com";

but

i wll send textbox value and label box value in the corresponding redirect page..
pl help me...

5
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by sibotho
0

hopefully, this will get you going in the right direction.

var tb = document.getElementById('TEXTBOXID');
var tbVal = '';
if(tb !=null)
 tbVal = tb.value;

window.location.href="fdfgd.com?tbVal="+tbVal;
0

exactly as campkey said, you can pass the values as part of the query string or you can store it in the session variable.

0

Why do you even redirect using javascript? :-/
Use code behind to redirect it.

In click event of the button:

Response.Redirect("~/MyPage.aspx?MyQuery=" & Me.MyTextBox.Text.Trim)
0

Why do you even redirect using javascript? :-/
Use code behind to redirect it.

In click event of the button:

Response.Redirect("~/MyPage.aspx?MyQuery=" & Me.MyTextBox.Text.Trim)

why? Because it saves you a roundtrip and a server call, and is faster and more efficient.

0

Because it saves you a roundtrip and a server call, and is faster and more efficient.

Well OK, but I don't think he's gonna save much.

0

why? Because it saves you a roundtrip and a server call, and is faster and more efficient.

Can you please show me this code in C#. I also have the same problem.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.