easy one I think! Property not recognised in HTML view

G

Guest

Hi there. I am a little confused. SelectedValue is a property of ListBox and
dropdownlist. However it isnt in the list of properties in intellisence (html
view i am not talking about code behind where it does list it). So when I
create my asp:ListBox and try to set SelectedValue=(to a databind value) it
has a squiggly line under it and says 'not recognised property of list box'.
The thing is, it works, so i have ignored it, but I would quite like to know
why this happens? Is it something I've missed?

Thanks.
 
C

Calvin Luttrell

Louise,

<asp:ListBox id="ListBox1" runat="server">
<asp:ListItem Value="test1">test1</asp:ListItem>
<asp:ListItem Value="test2" Selected="True">test2</asp:ListItem>
<asp:ListItem Value="test3">test3</asp:ListItem>
</asp:ListBox>

forums, articles, news -> www.ProjectThunder.com

-Calvin Luttrell
 
G

Guest

hi thanks calvin. I know that you can set an individual list item to be
selected, my question was more that if it works anyway, why does it put the
squiggly line under it in html view (I am setting the selectedvalue to a
datalist databind item), so in the definition of the dropdownlist i have

SelectedValue='<%# DataBinder.Eval(Container.DataItem,
"genderid").ToString() %>'

It works, but always underlines 'SelectedValue'. SelectedValue IS a property
of Dropdownlist, so why doesnt it like it?

Thanks and happy new year.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top