日期:2014-05-17 浏览次数:20827 次
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class test2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Literal1.Text = this.mydata.Value; } }
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test2.aspx.cs" Inherits="test2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>无标题页</title> </head> <body> <form id="form1" runat="server"> <input type="hidden" id="mydata" runat="server" /> <script type="text/javascript"> function LoadSys() { document.getElementById("mydata").value = screen.availWidth; } LoadSys(); </script> <asp:Literal ID="Literal1" runat="server"></asp:Literal> </form> </body> </html>