<head runat="server">
<title></title>
</head>
<body>
<input id="ScrWidth" runat="server" type="text" />
<script language="JavaScript">
var strScreenWidth = window.screen.width;
var strScreenHeight = window.screen.height;
document.getElementById("ScrWidth").value= strScreenWidth;
alert(strScreenWidth);
</script>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>在到台代码中得到的值为"";但alert(strScreenWidth); 可以有值
protected void Page_Load(object sender, EventArgs e)
{
string strValue = ScrWidth.Value;
strValue = Request.QueryString["ScrWidth"];
string strHeigth = ScrWidth.Value;
}
<title></title>
</head>
<body>
<input id="ScrWidth" runat="server" type="text" />
<script language="JavaScript">
var strScreenWidth = window.screen.width;
var strScreenHeight = window.screen.height;
document.getElementById("ScrWidth").value= strScreenWidth;
alert(strScreenWidth);
</script>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>在到台代码中得到的值为"";但alert(strScreenWidth); 可以有值
protected void Page_Load(object sender, EventArgs e)
{
string strValue = ScrWidth.Value;
strValue = Request.QueryString["ScrWidth"];
string strHeigth = ScrWidth.Value;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货