Second Super Simple Question (Which I cant get!)

  • Thread starter Thread starter Badass Scotsman
  • Start date Start date
B

Badass Scotsman

Hello,

I have some "runat server" form drop downs on the page, for example:

<asp:DropDownList ID="TypeOfParrot" Runat="server" name="TypeOfParrot"
class="textbox">
<asp:ListItem Value="">Please Select</asp:ListItem>
<asp:ListItem Value="Cockatoo">Cockatoo</asp:ListItem>
<asp:ListItem Value="MaCaw">MaCaw</asp:ListItem>
<asp:ListItem Value="African Grey">African Grey</asp:ListItem>
</asp:DropDownList>

So if the Querystring in the URL had domain.com?Parrot=Cockatoo , the
DropDownList above would default to this value both visually and behind the
scenes.

Any help again appreciated!!

Regards,

Gary.
 
What have you tried? It's very similar to your other post, but instead of
..Text, it's another property in a DropDownList. Hint, look for the word
"Selected.." in one of the properties.

Jeff
 
The easy way to do this is to have code in the background on your
onload function determine the value of the querystring. Then have it
iterate through the TypeOfParrot.listitems and then tell the
dropdownlist to select whichever Id you previously found.
KT
 
I was playing with SelectedIndex, but just kept getting annoying errors...

Clueless :)
 
So after an error, your tried something else right? Click once on
SelectedIndex, and press F1.

Did you try the other Selected.. properties? There are only 3 or so...

Let me know how it goes.

Jeff
 

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

Back
Top