·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> ASP.NET网站开发 >> ASP.NET菜鸟之路之Request小例子
<form id="form1" method="post" runat="server"> <div> <asp:TextBox ID="txtInput" runat="server" /> <asp:Button ID="btnSubmite" Text="提交" runat="server" OnClick="btnSubmite_Click" /> </div> </form>
PRotected void btnSubmite_Click(object sender, EventArgs e) { var input = Request.Form["txtInput"]; Response.Write("输入值是:"+ input); }
protected void Page_Load(object sender, EventArgs e) { var http = Request.Browser; Response.Write("浏览器名称:" + http.Browser + "</br>"); Response.Write("浏览器类型:" + http.Type + "</br>"); Response.Write("操作平台:" + http.Platform + "</br>"); }
显示效果如下