我是新手,我想练一下request和response 我先做了一个HTMLPAGE.htm页.然后在源里写了<from action="Defalu.aspx" metod="get">在Defalu.aspx.cs里写了下面的,想法是转换网页!现在没有连接数据库
string userName = Request.QueryString["text1"].ToString();
string userPwd = Request.QueryString["text2"].ToString();
if (userName ="a"&&userPwd = "a")
{
Response.Redirect("2.aspx"); }
else
{
Response.Redirect("long.htm");
}
可是一运行,就出显如下错误!晕
错误
1 运算符“&&”无法应用于“bool”和“string”类型的操作数 F:\wwwroot\a\Default.aspx.cs 17 13 http://localhost/a/
string userName = Request.QueryString["text1"].ToString();
string userPwd = Request.QueryString["text2"].ToString();
if (userName ="a"&&userPwd = "a")
{
Response.Redirect("2.aspx"); }
else
{
Response.Redirect("long.htm");
}
可是一运行,就出显如下错误!晕
错误
1 运算符“&&”无法应用于“bool”和“string”类型的操作数 F:\wwwroot\a\Default.aspx.cs 17 13 http://localhost/a/
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货