值未从javascript传递到c#
Asp.net c#值未从javascript传递到c#,javascript,c#,Javascript,C#,Asp.net c# username1获取空值。有人可以检查它是否正确吗?通过页面请求显式检索 string username1 = hdnfldVariable.Value; document.getElementById(“”)可能重复的 function GetUserName() { var wshell = new ActiveXObject("WScript.Shell"); var unamer = document.getElementById
username1获取空值。有人可以检查它是否正确吗?通过页面请求显式检索
string username1 = hdnfldVariable.Value;
document.getElementById(“”)代码>可能重复的
function GetUserName() {
var wshell = new ActiveXObject("WScript.Shell");
var unamer = document.getElementById('hdnfldVariable');
unamer.value = wshell.ExpandEnvironmentStrings("%USERNAME%");
}
string username1 = hdnfldVariable.Value;
string username1 = Page.Request.Form["hdnfldVariable"].ToString();