if (txtUserName.Text != "")
{
SPWeb currentWeb = SPContext.Current.Web;
SPList lstLogin = currentWeb.Lists["Login"];
SPListItemCollection myColl = lstLogin.Items;
foreach (SPListItem item in myColl)
{
if (item["UserName"].ToString() == txtUserName.Text)
{
item["PassWord"] = txtPassWord.Text;
item.Delete();
lblMessage.Text = "Deletion Successful";
Clear();
break;
}
}
}
Note:-
Here The above are having clear function here i am keeping the Clear function
public void Clear()
{
txtUserName.Text = "";
txtPassWord.Text = "";
txtUserName.Focus();
}
No comments:
Post a Comment