-
February 20th, 2009, 12:44 PM
#1
<option value=""> tag
Hello,
I need to be able to specify a value in my <option> tag inside of a <select> tag but the value is actually the id of a field.
Here is the code:
Code:
<select id="cmbLocation">
<%foreach(EnvironmentalMonitoring.Models.VqEmLocation location in ViewData["locations"] as IEnumerable<EnvironmentalMonitoring.Models.VqEmLocation>)%>
<%{ %>
<option value=""><%=location.Name%></option>
<%} %>
</select>
so where it says <option value = ""> I need to put location.id but I am not sure how the exact syntax should look like
Any help is appreciated
Thanks
Susan
-
February 20th, 2009, 12:51 PM
#2
Re: <option value=""> tag
I've tried putting <option value="<%=location.id%>"> but it does not like it
-
February 22nd, 2009, 10:44 PM
#3
Re: <option value=""> tag
Just one question.
Does it have to be a Html Control select control. If you make it a server control like a drop down list it would be much easier. As such the select control is a html control and that is one of the reasons the option tag refuses to accept <%=location.id%>. Let me know.
Warm Regards.
Originally Posted by Suzi167
I've tried putting <option value="<%=location.id%>"> but it does not like it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|