下面是asp.net如何判断提交方式的代码:
if (!IsPostBack)
{
if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
{
string sda = Request.QueryString["userid"];
Session["user"] = sda.ToString();
Response.Write(Session["user"].ToString());
}
}
<html xmlns=http://www.w3.org/1999/xhtml>
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" method="post">
<div>
<input type=submit value="提交">
</div>
</form>
</body>
</html>