如何通过一个查询字符串变量?

问题描述:

我想从第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;
        }