Hi
I am creating a website there are user login and admin login
I have already design the admin pages
now I want to design user default page when user login
i'm using 2nd master page for the user
it is possible to do this?
there are problem with the login when I login with admin it is properly login into the admin page
but when I login into user i'm unable to login
please help me with this...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
protected void Button1_Click(object sender, EventArgs e) {
SqlConnection con = new SqlConnection(@"Integrated Security=True");
con.Open();
SqlCommand cmd = new SqlCommand("select COUNT(*) FROM Registration WHERE Username='" + TextBox1.Text + "' and Password='" + TextBox2.Text + "'");
cmd.Connection = con;
int OBJ = Convert.ToInt32(cmd.ExecuteScalar());
if (OBJ > 0)
{
Session["name"] = TextBox1.Text;
Response.Redirect("Userdefaultpage.aspx");
}
else
{
Label1.Text = "Invalid username or password";
this.Label1.ForeColor = Color.Red;
}
con.Close();
}