我从这个项目得到错误,任何人都可以告诉为什么这个..错误是System.web.UI.Page.SuspendLayout [英] i got error from this project,any one can tell why is this.. error is System.web.UI.Page.SuspendLayout
本文介绍了我从这个项目得到错误,任何人都可以告诉为什么这个..错误是System.web.UI.Page.SuspendLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从这个项目得到错误,任何人都可以告诉为什么这个..
错误是System.web.UI.Page.SuspendLayout
i got error from this project,any one can tell why is this..
error is System.web.UI.Page.SuspendLayout
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace WebRole1
{
public partial class Userlogin : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(@"Data Source=RAVI;Initial Catalog=multicloud;user id=sa;password=123456");
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
con.Open();
SqlCommand comm = new SqlCommand("select * from users where username='" + TextBox1.Text + "' and password='" + TextBox2.Text + "'", con);
SqlDataReader drr = comm.ExecuteReader();
if (drr.Read())
{
Label1.Visible = false;
drr.Close();
SqlCommand comm1 = new SqlCommand("select * from users where username='" + TextBox1.Text + "' and password='" + TextBox2.Text + "' and status='YES'", con);
SqlDataReader drr1 = comm1.ExecuteReader();
if (drr1.Read())
{
Session["username"] = TextBox1.Text;
Response.Redirect("Home.aspx");
}
else
{
Label2.Visible = true;
Label1.Visible = false;
}
}
else
{
Label1.Visible = true;
Label2.Visible = false;
}
}
}
}
推荐答案
这篇关于我从这个项目得到错误,任何人都可以告诉为什么这个..错误是System.web.UI.Page.SuspendLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文