473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Second Super Simple Question (Which I cant get!)

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.

May 18 '06 #1
4 1068
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

"Badass Scotsman" <ba*************@aye.net> wrote in message
news:e4*******************@news.demon.co.uk...
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.

May 18 '06 #2
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

May 18 '06 #3
I was playing with SelectedIndex, but just kept getting annoying errors...

Clueless :)
"Jeff Dillon" <je********@hotmail.com> wrote in message
news:O6**************@TK2MSFTNGP04.phx.gbl...
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

"Badass Scotsman" <ba*************@aye.net> wrote in message
news:e4*******************@news.demon.co.uk...
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.


May 18 '06 #4
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

"Badass Scotsman" <ba*************@aye.net> wrote in message
news:e4*******************@news.demon.co.uk...
I was playing with SelectedIndex, but just kept getting annoying errors...

Clueless :)
"Jeff Dillon" <je********@hotmail.com> wrote in message
news:O6**************@TK2MSFTNGP04.phx.gbl...
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

"Badass Scotsman" <ba*************@aye.net> wrote in message
news:e4*******************@news.demon.co.uk...
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.



May 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: shank | last post by:
I need a super simple 100% ASP and/or VBScript shopping cart. No JavaScript allowed! Can write to cookies, but not a database. (Sessions maybe OK) I don't need any special buttons and whistles and...
1
by: bayouprophet | last post by:
Cant get menu script to to put linked page in the same frame. I am new to Java and I am wondering what am I doing wrong? below are my java applet file, frame.html file, and my text file and one...
4
by: gregsands | last post by:
Hi I have read all (ok most) of the posts relating to "Call to undefined function mysql_connect()", read the manual on PHP.net and done eveything thats ive been asked to do but cant get PHP to...
4
by: Martin Fletcher | last post by:
I cant get the Concat function to work, please help. Here's some of my code. Module modTCP Public TCP_RECEIVED_DATA As String Private WithEvents TCP_SERVER As New WinSockSVR Private Sub...
8
by: Jim Florence | last post by:
Hi, I've just add a couple of dropdowns to my ASP form, set up a sqldatasource and bound to the dropdown and it all works great. I want the first item of the dropdown to be blank soa fter...
0
by: riteshraha | last post by:
Hi everyone, I am a member of this forum. i have posted my problem repeatedly to this forum. but i cant get any reply from this forum. plz anyone make any reply of my problem. I cant retrieve...
1
by: Johan | last post by:
Hi! I cant get the ToolStripProgressbar property "Style.Continuous" to work in my Windows form application. The progress bar still have the default look(blocks) when i run it. Is there any...
0
leafgreen
by: leafgreen | last post by:
Hey everyone. Thanks for helping me with these two super-simple newbie questions. I use DW8. 1. On this page http://adswebsite.net/yahoo-search-versus-google-adwords, on the right column where it...
3
by: =?Utf-8?B?Y29yeQ==?= | last post by:
i cant get the playstation 3 to connect to call of duty 4 online through the router but i am able to connect to the game online through the modem. I am able to still get on the internet through the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.