but you can use session in ur login page
protected
void imgbtnsubmit_Click(object sender, ImageClickEventArgs e)
{
if (txtconform.Text == string.Empty && txtnew.Text == string.Empty && txtconform.Text!=txtnew.Text)
{
lblerror.Visible =
true;
lblerror.ForeColor = System.Drawing.
Color.RosyBrown;
lblerror.Text =
"All fields are Requried";
}
else
{
try
{
SqlConnection con = new SqlConnection("Data Source=HOSERVER\\SQLEXPRESS;Initial Catalog=office;User ID=sa;Password=admin;"
);
SqlCommand cmd = new SqlCommand("update usermaster set User_Password=@User_Password where EMP_ID='"+ Session["empid"].ToString() + "'"
, con);
con.Open();
cmd.Parameters.Add(
new SqlParameter("@User_Password", SqlDbType
.VarChar, 20));
cmd.Parameters[
"@User_Password"
].Value = txtconform.Text;
cmd.ExecuteNonQuery();
lblerror.Visible =
true
;
lblerror.ForeColor = System.Drawing.
Color
.Green;
lblerror.Text =
"Password Changed"
;
con.Close();
txtcurrent.Text =
string
.Empty;
txtnew.Text =
string
.Empty;
txtconform.Text =
string
.Empty;
}
catch
{
lblerror.Visible =
true
;
lblerror.ForeColor = System.Drawing.
Color
.Cyan;
lblerror.Text =
"Password not Changed"
;