473,396 Members | 2,036 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.

question on DropDownList control.

hi, a newbie question
I have two dropdownlist controls, one is for years, 2000-2003, the other is
for month, 1-12.

I am supposed to get all the data records in the selected year & month when
i click "submit" button, but the weird thing is I can only get the records
of 01/2000, no matter what year and month i selected from the drop down
list.

and when the page reloaded, the selected items in drop downlist set to year
2000 and month 1.

Who can give me a hint , what is wrong?
I am sure the sql is right.

Thank you so much!!
Nov 17 '05 #1
4 1975
am I use it correctly?

String Year = MyDropDownList.SelectedItem.ToString();

String Month = MyDropDownList2.SelectedItem.ToString();

"Tony" <gd****@hotmail.com> wrote in message
news:Ou**************@tk2msftngp13.phx.gbl...
hi, a newbie question
I have two dropdownlist controls, one is for years, 2000-2003, the other is for month, 1-12.

I am supposed to get all the data records in the selected year & month when i click "submit" button, but the weird thing is I can only get the records
of 01/2000, no matter what year and month i selected from the drop down
list.

and when the page reloaded, the selected items in drop downlist set to year 2000 and month 1.

Who can give me a hint , what is wrong?
I am sure the sql is right.

Thank you so much!!

Nov 17 '05 #2
am I use it correctly?

String Year = MyDropDownList.SelectedItem.ToString();

String Month = MyDropDownList2.SelectedItem.ToString();

"Tony" <gd****@hotmail.com> wrote in message
news:Ou**************@tk2msftngp13.phx.gbl...
hi, a newbie question
I have two dropdownlist controls, one is for years, 2000-2003, the other is for month, 1-12.

I am supposed to get all the data records in the selected year & month when i click "submit" button, but the weird thing is I can only get the records
of 01/2000, no matter what year and month i selected from the drop down
list.

and when the page reloaded, the selected items in drop downlist set to year 2000 and month 1.

Who can give me a hint , what is wrong?
I am sure the sql is right.

Thank you so much!!

Nov 17 '05 #3
Do you set values declaratively or in code? If in code, you do that only on
initial request hat is not on postback?

--
Teemu Keiski
MCP,Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com

"Tony" <gd****@hotmail.com> kirjoitti viestissä
news:ef**************@TK2MSFTNGP12.phx.gbl...
am I use it correctly?

String Year = MyDropDownList.SelectedItem.ToString();

String Month = MyDropDownList2.SelectedItem.ToString();

"Tony" <gd****@hotmail.com> wrote in message
news:Ou**************@tk2msftngp13.phx.gbl...
hi, a newbie question
I have two dropdownlist controls, one is for years, 2000-2003, the other

is
for month, 1-12.

I am supposed to get all the data records in the selected year & month

when
i click "submit" button, but the weird thing is I can only get the records of 01/2000, no matter what year and month i selected from the drop down
list.

and when the page reloaded, the selected items in drop downlist set to

year
2000 and month 1.

Who can give me a hint , what is wrong?
I am sure the sql is right.

Thank you so much!!


Nov 17 '05 #4
Do you set values declaratively or in code? If in code, you do that only on
initial request hat is not on postback?

--
Teemu Keiski
MCP,Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com

"Tony" <gd****@hotmail.com> kirjoitti viestissä
news:ef**************@TK2MSFTNGP12.phx.gbl...
am I use it correctly?

String Year = MyDropDownList.SelectedItem.ToString();

String Month = MyDropDownList2.SelectedItem.ToString();

"Tony" <gd****@hotmail.com> wrote in message
news:Ou**************@tk2msftngp13.phx.gbl...
hi, a newbie question
I have two dropdownlist controls, one is for years, 2000-2003, the other

is
for month, 1-12.

I am supposed to get all the data records in the selected year & month

when
i click "submit" button, but the weird thing is I can only get the records of 01/2000, no matter what year and month i selected from the drop down
list.

and when the page reloaded, the selected items in drop downlist set to

year
2000 and month 1.

Who can give me a hint , what is wrong?
I am sure the sql is right.

Thank you so much!!


Nov 17 '05 #5

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

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
1
by: Moshfegh Hamedani | last post by:
Hi there, I found this question in Amit Kalani's preparation book for exam 70-15 (Developing Web Applications with C#). I think it's a very stupid question! It says the correct answer is A but...
0
by: Moshfegh Hamedani | last post by:
Hi there, I found this question in Amit Kalani's preparation book for exam 70-15 (Developing Web Applications with C#). I think it's a very stupid question! It says the correct answer is A but...
10
by: Sacha Korell | last post by:
I'm trying to load a drop-down list with all DropDownList control names from another page. How would I be able to find those DropDownList controls? The FindControl method will only find a...
1
by: Phil | last post by:
I would like to make the CreateUserWizard's security question box display as a databound (xml file) dropdownlist. I can make the dropdownlist display by using a contenettemplate, but I can't get...
2
by: glenn | last post by:
Hi folks, I am trying to determine which item in a DropDownList Web control has been selected. I have posted an OnSelectedIndexChanged subroutine in my code with a reference to the subroutine...
15
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an...
1
by: DJ | last post by:
I have a DropDownList in Visual Web Developer that is databound to a SQL Database. Whenever the web page is opened the DropDownList is automatically filled with the first item in the table. My...
3
by: RSH | last post by:
I have a simple question regarding inheritance in a web form. I have a DropDownList in an aspx form. It is called DropDownList1 I have a class that will be overriding the render event so I...
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.