可以这样做:
1、首先在页面上建两个html控件:
<INPUT id="Text1" style="BORDER-RIGHT: #9999cc thin solid; BORDER-TOP: #9999cc thin solid; Z-INDEX: 121; LEFT: 376px; BORDER-LEFT: #9999cc thin solid; WIDTH: 82px; BORDER-BOTTOM: #9999cc thin solid; POSITION: absolute; TOP: 14px; HEIGHT: 21px" type="text" size="8" value="1" name="Text1" runat="server">
<INPUT id="Text2" style="BORDER-RIGHT: #9999cc thin solid; BORDER-TOP: #9999cc thin solid; Z-INDEX: 121; LEFT: 376px; BORDER-LEFT: #9999cc thin solid; WIDTH: 82px; BORDER-BOTTOM: #9999cc thin solid; POSITION: absolute; TOP: 14px; HEIGHT: 21px" type="text" size="8" value="1" name="Text2" runat="server">其中,runat="server"是在设计器中右击选作为服务器控件运行。用来存放分辩率。
2、在客户端脚本中:
window.document.all.item("Text1").value=screen.width;
window.document.all.item("Text2").value=screen.height;
这样,分辨率就存放在控件中了。
注意:此脚本应放在aspx代码的底部,即</body>上端,否则在页面初始加载时因这两个控件还未生成,会报错。
3、在服务器端代码需要用到的地方:
string pagewidth=Request.Form["Text1"].ToString();
string pageheight=Request.Form['Text2"].ToString();
4、将这两个控件的z-index设为最小,如1,隐藏在其它控件底下,以免破坏页面。
5、当然,分辨率也可以存放在其它类型的控件里,但上述控件是我已试验成功的。
  挺麻烦的吧,没办法。我现在就是这样做的,不过是用来隨着分辨率大小来调整image大小的。