62,046
社区成员
发帖
与我相关
我的任务
分享
<form id="uploadForm" runat="server" defaultbutton="btnlogin">
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="232" valign="top"><!--#include file="leftbar.aspx"--></td><%--左侧的用户登录窗口--%>
<td>右侧的上传图片的区域</td>
</form>
Response.Write("<script>window.parent.location.href='Default.aspx';"+"</scr" + "ipt>");
Response.End();
编译器错误信息: CS1010: 常量中有换行符
源错误:
行 51: //Response.Redirect("Default.aspx",false);
行 52: //Server.Transfer("Default.aspx");
行 53: Response.Write("<script>window.parent.location.href='Default.aspx';</script>");
行 54: Response.End();
行 55: }
源文件: e:\Development\TotalPro\ershouback\leftbar.aspx 行: 53
Response.Write("<script>window.parent.location.href='Default.aspx';<//script>");
Response.End();
Response.Write("<script>window.parent.location.href='Default.aspx';</script>");
protected void btnlogin_Click(object sender, EventArgs e)
{
if (IsValid)
{
if (txtacc.Text.Trim() == "" || txtpsd.Text.Trim() == "")
{
lbltip.Text = "用户名或密码为空!";
}
else
{
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["ershouConnectionString"].ToString());
if (conn.State != System.Data.ConnectionState.Open)
{
conn.Open();
}
//string sql = "select n_id,n_title,convert(varchar(10),n_time,120) as n_time from t_notice order by n_time desc";
System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("select * from t_user where u_name='" + txtacc.Text.ToString() + "' and u_password='" + txtpsd.Text.ToString() + "' and u_state='正常'", conn);
//SqlDataReader dr = app.ExecuteReader("select * from t_user where u_name='" + txtacc.Text.ToString() + "' and u_password='" + txtpsd.Text.ToString()+"' and u_state='正常'");
System.Data.SqlClient.SqlDataReader dr = cmd.ExecuteReader();
cmd.Dispose();
if (!dr.Read())
{
lbltip.Text = "用户名或密码有误!";
dr.Dispose();
conn.Dispose();
}
else
{
Session["account"] = txtacc.Text.ToString();
Session["password"] = txtpsd.Text.ToString();
dr.Dispose();
conn.Dispose();
//Response.Redirect("Default.aspx",false);
//Server.Transfer("Default.aspx");
Response.Write("<script>window.parent.location.href='Default.aspx';<//script>");
Response.End();
}
}
}
}
Response.Write("<script>window.parent.location.href='default.aspx';</script>");
Response.End();