我用的是c# 我的 login.htm中的代码是
<!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>
<title>无标题页</title>
<script language="javascript" type="text/javascript">
// <!CDATA[function Submit1_onclick() {}
// ]]>
</script>
</head>
<body><form action="Default.aspx" method="post">
用户名 :<input id="Text1" type="text" /><br />
密 码:
<input id="Text2" type="text" /><br />
<br />
<input id="submit" type="submit" value="登陆" onclick="return Submit1_onclick()" />
</form></body>
</html>
在我的Default.aspx中主要代码是 protected void Page_Load(object sender, EventArgs e)
{ try
{
//string a = Request["Text1"].ToString(); //string b = Request["Text2"].ToString(); //string a = Request.Form.Get("Text1").ToString(); //string b = Request.Form.Get("Text2").ToString(); string a = Request.Form["Text1"].ToString();
string b = Request.Form["Text2"].ToString();
if (a == "zhang")
{
Response.Redirect("s.aspx");
} }
catch(Exception){} 为什么Default.aspx中接受不到login 的文本筐数据呢中的数据呢
<!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>
<title>无标题页</title>
<script language="javascript" type="text/javascript">
// <!CDATA[function Submit1_onclick() {}
// ]]>
</script>
</head>
<body><form action="Default.aspx" method="post">
用户名 :<input id="Text1" type="text" /><br />
密 码:
<input id="Text2" type="text" /><br />
<br />
<input id="submit" type="submit" value="登陆" onclick="return Submit1_onclick()" />
</form></body>
</html>
在我的Default.aspx中主要代码是 protected void Page_Load(object sender, EventArgs e)
{ try
{
//string a = Request["Text1"].ToString(); //string b = Request["Text2"].ToString(); //string a = Request.Form.Get("Text1").ToString(); //string b = Request.Form.Get("Text2").ToString(); string a = Request.Form["Text1"].ToString();
string b = Request.Form["Text2"].ToString();
if (a == "zhang")
{
Response.Redirect("s.aspx");
} }
catch(Exception){} 为什么Default.aspx中接受不到login 的文本筐数据呢中的数据呢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货