Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过javascript窗口传递querystring值。打开_Javascript_Asp.net - Fatal编程技术网

通过javascript窗口传递querystring值。打开

通过javascript窗口传递querystring值。打开,javascript,asp.net,Javascript,Asp.net,我需要使用window.open将存储在asp hiddenfield中的pass值传递给querystring onclick="window.open('../New/FeedbackV4.aspx','FeedbackWindow','width=960,height=640,scrollbars=yes,resizable=yes,status=yes')" 我需要获取隐藏字段的值并将其作为查询字符串传递为简单起见,假设隐藏字段有一个id属性,比如id='foo'(如果没有,您需要找到

我需要使用window.open将存储在asp hiddenfield中的pass值传递给querystring

onclick="window.open('../New/FeedbackV4.aspx','FeedbackWindow','width=960,height=640,scrollbars=yes,resizable=yes,status=yes')"

我需要获取隐藏字段的值并将其作为查询字符串传递

为简单起见,假设隐藏字段有一个
id
属性,比如
id='foo'
(如果没有,您需要找到另一种提取该元素的方法),使用

(请注意,添加了“?”)


功能par(elid){
var elem=document.getElementById(elid);
返回encodeURI(elem.name)+'='+encodeURI(elem.value);
}

我不确定自己是否完全理解上下文,但给出了一个
隐藏字段

<asp:HiddenField ID="hf_myhiddenfield" runat="server" Value="hidden value"/>
Javascript

<script type="text/javascript">
    function GetHFValue() {
        var hf_value = '?' + document.getElementById("<%= hf_myhiddenfield.ClientID %>").value;
        return hf_value;
    }
</script>

函数GetHFValue(){
var hf_value='?'+document.getElementById(“”.value);
返回hf_值;
}

oops。。。我需要获取隐藏字段的值,并将其作为查询字符串传递。。
<asp:HiddenField ID="hf_myhiddenfield" runat="server" Value="hidden value"/>
onclick="window.open('../New/FeedbackV4.aspx'+GetHFValue(),'FeedbackWindow','width=960,height=640,scrollbars=yes,resizable=yes,status=yes')"   
<script type="text/javascript">
    function GetHFValue() {
        var hf_value = '?' + document.getElementById("<%= hf_myhiddenfield.ClientID %>").value;
        return hf_value;
    }
</script>