Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two .aspx pages i.e. WebForm1 & WebForm2. I want to pass param value 30 from Page1 to page2 using Jquery. How can I receive that value in **Page2** and populate a label with that? I can not use any backend module for this. It should be purely client side operation.

If anyone have solution please reply. Thanks in advance


What I have tried:

JavaScript
$(document).ready(function () {

    var data = "T260203";
    var param = 30;
    var redirectUrl = "../WebForm2.aspx";

    $('#btnGo').click(function (e) {

        $('#txtInput').val(data);                                      
        //location.href = '../WebForm2.aspx';
        var url = redirectUrl;
        $(location).attr('href', url);
        $("#txtInput").val("");
    });
});
Posted
Updated 26-Oct-16 23:22pm
v2

if you want to pass some thing.
JavaScript
$('#btnGo').click(function (e) {

var paramvalue= values;
url=webform2.aspx?paramID=paramvalue;
location.href =url;
}

using request.querystring you can retirve.
 
Share this answer
 
I know this comes as a shock to many developers, but the internet worked long before jQuery was invented, and in fact it actually works without any javascript at all. If you want to pass data from one page to another on the click of a button you use a form, no javascript needed at all.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900