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
rickyvalkier dddd
NA
10
8.7k
add foreach item to asp:label
Sep 14 2016 11:29 AM
hi,
in my aspx file ive got the following code:
<table>
<% foreach (var number in Numbers)
{ %>
<tr>
<td><%= number %> <asp:Label ID=
"alternatenumberLabel"
runat=
"server"
CssClass=
"label-xxxl"
Text=
"<%= number %>"
></asp:Label></td>
<td><asp:Button ID=
"Button"
runat=
"server"
CommandName=
"Submit"
Text=
"> Wijzigen"
UseSubmitBehavior=
"false"
CssClass=
"button"
OnClick=
"EditButton_Click"
ValidationGroup=
"EditUserGroup"
/></td>
</tr>
<% } %>
</table>
when I run the code the <td><%= number %> part shows the result of the foreach item. However the asp:label text is shown as plain text instead of getting the value, and I need to put it on a label, so can somebody tell me what i'm doing wrong so I can just show only a label that contains the foreach iten and the button. so withoud the first part <td><%= number %> .
thnx guys
Reply
Answers (
3
)
set focus on first input control automatically for error
Change FirstChildNode left position as same to its parent