TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sheikh parvaz
NA
199
108.6k
checkchanged problem
Dec 1 2012 2:12 AM
the below code is not handling the event correctly showing the error of user already there or not there, when check is changed i.e user is added or removed from the role.
protected void RoleCheckBox_CheckChanged(object sender, EventArgs e)
{
CheckBox RoleCheckBox = sender as CheckBox;
string selectedUserName = UserList.SelectedValue;
string roleName = RoleCheckBox.Text;
if (RoleCheckBox.Checked)
{
Roles.AddUserToRole(selectedUserName, roleName);
ActionStatus.Text = string.Format("User {0} Was added to role {1}.", selectedUserName, roleName);
}
else
{
Roles.RemoveUserFromRole(selectedUserName, roleName);
ActionStatus.Text = string.Format("User {0} was removed from role {1}.", selectedUserName, roleName);
}
}
Reply
Answers (
0
)
.Net
Searching Record in ASP.NET MVC (EF)