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

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;

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

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

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.

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.