如何通过一个查询字符串变量? [英] How to pass a query string variable?

查看:98
本文介绍了如何通过一个查询字符串变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从第1页传递类变量上的链接按钮,点击另一页。链接按钮单击事件是写在JavaScript的查询,如下所示:

I want to pass a class variable from 1 page to another page on link button click. The link button click event is written in the javascript query as follows:

<script type="text/javascript">
        function RedirectTo() {
            window.location.href = 'ApplyJobsByCandidate.aspx';
            return false;
        }

现在如何传递一个类变量通过查询字符串?我想是这样'ApplyJobsByCandidate.aspx ID ='+ Class1.ID;

Now how can i pass a class variable through the query string? I want something like 'ApplyJobsByCandidate.aspx?id='+Class1.ID;

请帮我。

推荐答案

您可以在值传递给函数,然后访问其添加到查询字符串

You can pass in the value into the function, then access add it into the query string

<script type="text/javascript">
        function RedirectTo(id) {
            window.location.href = 'ApplyJobsByCandidate.aspx?id=' + id;
            return false;
        }

这篇关于如何通过一个查询字符串变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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