I have one grid view with 4 columns(UserId,Description,Password,Change Password). when i click on change password the panel with 3 textboxes(UserID,New Password,Confirm Password) and save button appears. after changing password the panel disappears but the password in the gridview remains same as previous. i want to update the password column.
The code is in C# and back end is MySQL DB Server.. please help..
Loading

Abhijit baruaRank #3,722 · 397 reputationPosted Jun 1, 2012, 1:53 AM EDT
Abhijit baruaRank #3,722 · 397 reputationPosted May 31, 2012, 4:05 AM EDT
Abumiyan Muqri43 reputationPosted May 31, 2012, 4:20 AM EDT
protected void BindGridView()
{
try
{
DataTable dt = new DataTable();
dt = (DataTable)Session["userinfo"];
gvPassInfo.DataSource = dt;
gvPassInfo.DataBind();
}
catch (Exception ex)
{
//lblMessage.Text = DataObjects.Error_Message();
}
}
protected void gvPassInfo_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "change")
{
panelChangePassword.Visible = true;
}
}
protected void gvPassInfo_RowEditing(object sender, GridViewEditEventArgs e)
{
string user = gvPassInfo.DataKeys[e.NewEditIndex].Value.ToString();
Session["user"] = user.ToString();
panelChangePassword.Visible = true;
txtUserid.Enabled = false;
//txtUserid.Text = gvPassInfo.SelectedRow.Cells[0].Text;
txtUserid.Text = user.ToString();
}
protected void btnSave_Click(object sender, EventArgs e)
{
clsUser objuser = new clsUser();
//string user = Session["user"].ToString();
string user = txtUserid.Text;
string NewPassword = txtNewPassword.Text;
string ConfirmPassword = txtConfirmNewPassword.Text;
Response.Write("");
BindGridView();
panelChangePassword.Visible = false;
}
Abhijit baruaRank #3,722 · 397 reputationPosted May 31, 2012, 4:51 AM EDT
Abumiyan Muqri43 reputationPosted May 31, 2012, 9:02 PM EDT
Abhijit baruaRank #3,722 · 397 reputationPosted May 31, 2012, 10:05 PM EDT
datatable dt=new datatable();
gvPassInfo.DataSource = dt;
gvPassInfo.DataBind();
Abumiyan Muqri43 reputationPosted Jun 1, 2012, 1:34 AM EDT
Abumiyan Muqri43 reputationPosted Jun 1, 2012, 1:58 AM EDT
Thanks..