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
Fares Ayyad
NA
235
74.2k
Asp.net/C# Get repeater row data through checkbox
Nov 10 2016 7:58 AM
Hello i have a repeater that will present data as a table with checkbox for each row, so i want to show the checked rows data when a button is clicked.
.aspx code:
"rptItems"
runat=
"server"
>
class
=
"table table-bordered table-hover table-responsive table-striped table-condensed"
>
Goods Desc
Balance Units
Exit Units
"cbItem"
runat=
"server"
/>
<%#Eval(
"ItemDesc"
) %>
<%#Eval(
"InvoicBalanceUnits"
) %>
"txtExitUnits"
runat=
"server"
>
"revUnits"
runat=
"server"
Display=
"Dynamic"
ControlToValidate=
"txtExitUnits"
ValidationExpression=
"^\d+$"
ErrorMessage=
"Please, insert a number."
CssClass=
"text-danger"
>
"rfvUnits"
runat=
"server"
Display=
"Dynamic"
ControlToValidate=
"txtExitUnits"
ErrorMessage=
"Insert number of units."
CssClass=
"text-danger"
>
the code behind:
protected
void
btnExit_Click(
object
sender, EventArgs e)
{
List
selectedItems = rptItems.Items.Cast
().Where(x => ((CheckBox)x.FindControl(
"cbItem"
)).Checked).ToList();
epeater1.DataSource = selectedItems;
Repeater1.DataBind();
Repeater1 will contain the data selected through :
selectedItems
this is the repeater1
"Repeater1"
runat=
"server"
>
class
=
"table table-bordered table-hover table-responsive table-striped table-condensed"
>
Goods Desc
Balance Units
<%#Eval(
"ItemDesc"
) %>
<%#Eval(
"InvoicBalanceUnits"
) %>
when i run the code it gives me an error that "ItemDesc" isn't exist in repeater1, whats wrong ?
Reply
Answers (
2
)
Windows authentication user log?
next and previous link in hard coding in asp.net core mvc