473,508 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set Select Control's Value from Querystring

This is probably very easy.

How do I set an HTML select control's value from the querystring?

This is what I have...but, only the select control's value doesn't get
set.
CustomerSelect.Value = Request.QueryString("cus")
StartDate.Text = Request.QueryString("Sdate")

This works...
StartDate.Text = Request.QueryString("cus")

Thanks,
j.t.w
Feb 20 '08 #1
2 2142
If you just want a dropdown, consider the server controls rather than HTML
controls and then set selected value to the key value you wish. I can look
at the HTML control and probably guide there, but the server controls are
fairly straightforward.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"j.t.w" <j.***@juno.comwrote in message
news:a9**********************************@q78g2000 hsh.googlegroups.com...
This is probably very easy.

How do I set an HTML select control's value from the querystring?

This is what I have...but, only the select control's value doesn't get
set.
CustomerSelect.Value = Request.QueryString("cus")
StartDate.Text = Request.QueryString("Sdate")

This works...
StartDate.Text = Request.QueryString("cus")

Thanks,
j.t.w

Feb 20 '08 #2
Try setting the SelectedValue or SelectedText properties.

"j.t.w" <j.***@juno.comwrote in message
news:a9**********************************@q78g2000 hsh.googlegroups.com...
This is probably very easy.

How do I set an HTML select control's value from the querystring?

This is what I have...but, only the select control's value doesn't get
set.
CustomerSelect.Value = Request.QueryString("cus")
StartDate.Text = Request.QueryString("Sdate")

This works...
StartDate.Text = Request.QueryString("cus")

Thanks,
j.t.w

Feb 20 '08 #3

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

Similar topics

2
2323
by: Matthew Louden | last post by:
I am using VBScript for ASP. The control value must be case sensitive? The following example should print the "fname" value, but if if I change "submit" back to "SUBMIT". Then it works fine. <%...
6
1328
by: Jack | last post by:
Hello, <%@ Language=VBScript %> <% Response.Write "<FORM name=form1>" Response.Write "<select name=""select1"">" Response.Write "<option value=1>One</option>" Response.Write "<option...
2
1531
by: Johan Christensson | last post by:
Hi. I'm woundering if it's possibel to transfer a OnAction value from a drop-down box in an ASP page without having to use Java code? I mean something like this: <% Sub resposeprocess
3
10813
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1...
5
2771
by: footballhead | last post by:
I have a site that has MANY different clothing categories. I have a page set up for displaying the products (productsearch.aspx) when a user clicks one of the category links on the navigation menu....
3
3378
by: mark.irwin | last post by:
Hello all, Have an issue where a redirect pushes data to a page with a select case which then redirects to another page. Problem is the redirect isnt working in 1 case. Code below: strURL =...
8
2251
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
4
1611
by: Jeff | last post by:
Hey gang. I have a form to select multiple names. The problem I am having, is when it gets to the asp page. If I click 1 name, it will process. But multiple names gives me an error: Either BOF or...
3
3031
by: mso5 | last post by:
Hi, I am trying to build a small form with a list of countries and regions by each country (yes, the classical one), and I'm stuck with it. I'm using AJAX also, and I manage to get the correct...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7124
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
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.