asp.net如何判断提交方式

来源:互联网 发布:全面预算软件 编辑:程序博客网 时间:2024/05/16 19:14
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>
0 0
原创粉丝点击