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
Big Pimpin
NA
3
2.4k
Capture Checked Check Box Values
Oct 4 2015 10:18 PM
I have a panel that is being populated in my asp.net application. I need to capture the selected values (I.E. the check boxes that have been captured). This is my syntax which appears to be syntatically correct, but it is not capturing the checked checkboxes. What did I set-up incorrect?
[code]
<asp:Panel ID="pnlTest" runat="server" CssClass="scrollingControlContainer scrollingCheckBoxList">
<font class="BoldTextBlack">Select Active Students</font>
<asp:Button runat="server" ID="buttonClearCheckedBoxes" CssClass="Buttons" Text="Clear"
OnClick="buttonClearCheckedBoxes_Click" />
<br />
<asp:CheckBoxList runat="server" ID="chkBoxes" RepeatColumns="6" RepeatDirection="Horizontal"></asp:CheckBoxList>
</asp:Panel>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
PopulateAllStudents();
}
}
private void PopulateAllStudents()
{
this.chkBoxes.DataSource =
this.chkBoxes.DataTextField = "StudentFullName";
this.chkBoxes.DataValueField = "StudentID";
this.chkBoxes.DataBind();
}
protected void btnClickIT_click(object sender, EventArgs e)
{
try
{
foreach (ListItem item in this.chkBoxes.Items)
{
if (item.Selected)
{
//Do Stuff Here
}
}
}
catch
{
}
}
[/code]
Reply
Answers (
0
)
Cannot find table 0. Description: An unhandled exception
how to use stored procedure in mvc 4 using code first