Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Reply
add foreach item to asp:label
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
rickyvalkier dddd
8y
270
1
Reply
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
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
set focus on first input control automatically for error
Change FirstChildNode left position as same to its parent