Databinding DropDownList is removing ListItems

L

Leroy

I'm fairly new to the .NET environment. I'm currently using ASP.NET
2, VS 2005 Beta.

I have a FormView with a DropDownList bound to a SQLDataSource. The
code looks like this:

<asp:DropDownList Runat="Server" ID="SecurityRole" Width="100px"
DataSourceID="SqlDataSource1" DatatextField="SecurityRole">
<asp:ListItem Value="Requester">Requester</asp:ListItem>
<asp:ListItem Value="Approver">Approver</asp:ListItem>
</asp:DropDownList></td>

The problem I'm running into, is when the page loads and the FormView
gets bound via the SQLDataSource, the "SecurityRole" field gets loaded
into the DropDownList, but at this point the ListItems (Requester and
Approver) disappear. The only item in the DropDownList is the value
it grabs from the SQL table. Hope I'm making sense.

Thanks in advance for any help.
 

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

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top