如何使用jquery从一个.aspx页面传递参数并在另一个.aspx页面中接收该值? [英] How to pass parameter from one .aspx page using jquery and receive the value in another .aspx page?

查看:69
本文介绍了如何使用jquery从一个.aspx页面传递参数并在另一个.aspx页面中接收该值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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:

$(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("");
    });
});

推荐答案

document )。ready ( function (){

var data = T260203;
var param = 30 ;
var redirectUrl = < span class =code-string> ../ WebForm2.aspx;
(document).ready(function () { var data = "T260203"; var param = 30; var redirectUrl = "../WebForm2.aspx";


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


' #txtInput')。val(data);
// location.href ='../ WebForm2.aspx';
var url = redirectUrl;
('#txtInput').val(data); //location.href = '../WebForm2.aspx'; var url = redirectUrl;


这篇关于如何使用jquery从一个.aspx页面传递参数并在另一个.aspx页面中接收该值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆