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 baruaPosted Jun 1, 2012, 5:53 AM
Abumiyan MuqriPosted Jun 1, 2012, 5:58 AM
Thanks..
Abumiyan MuqriPosted Jun 1, 2012, 5:34 AM
Abhijit baruaPosted Jun 1, 2012, 2:05 AM
datatable dt=new datatable();
gvPassInfo.DataSource = dt;
gvPassInfo.DataBind();
Abumiyan MuqriPosted Jun 1, 2012, 1:02 AM
Abhijit baruaPosted May 31, 2012, 8:51 AM
Abumiyan MuqriPosted May 31, 2012, 8:20 AM
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 baruaPosted May 31, 2012, 8:05 AM