473,385 Members | 1,720 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,385 software developers and data experts.

DropDown question

Jon
I am using cascading dropdowns, where the selection in one determines what
fills another. In regular ASP I simply loaded a giant dataset into
javascript array and when you clicked on one dropdown, it populated the
others accordingly.

In ASP.Net, I was looking for a way to do this without javascript. So, I
made my form and put code in the SelectedIndexChanged event of the dropdown
that populates the next dropdown. Of course to do this, you have to submit
the form. Is there a way of determining when the form has been truly
submitted and when it's been submitted simply to fill in the next dropdown?
I'm thinking not, but thought I'd ask before I revert to my javascript
method.

Thanks

--
********************************
Jon Rosenberg
Nov 18 '05 #1
3 1559
Jon,

Try not to think of the the form as being trully submitted or not. In
essence to get anything done in ASP.NET you must postback, what determines
what happens is what causes the postback. In your case:

the SelectedIndexChanged event of dropdown one, will cause you to get the
value of the selected item and populate dropdown two based on that value.

Somewhere at the bottom you mayhave a button on the Click event you may then
look at the values of the selected items in dropdown lists one and two and
then perform some action.

The need for you to determine when the form has been 'trully' submitted is
done for you by means of which events are fired, if the button is click you
then know they want to submit their selections.

MattC

"Jon" <ru******@msn.com> wrote in message
news:10*************@corp.supernews.com...
I am using cascading dropdowns, where the selection in one determines what
fills another. In regular ASP I simply loaded a giant dataset into
javascript array and when you clicked on one dropdown, it populated the
others accordingly.

In ASP.Net, I was looking for a way to do this without javascript. So, I
made my form and put code in the SelectedIndexChanged event of the dropdown that populates the next dropdown. Of course to do this, you have to submit the form. Is there a way of determining when the form has been truly
submitted and when it's been submitted simply to fill in the next dropdown? I'm thinking not, but thought I'd ask before I revert to my javascript
method.

Thanks

--
********************************
Jon Rosenberg

Nov 18 '05 #2
If you set the AutoPostBack property of each dropdown list to True, it will
trigger the SelectedIndexChanged event as a postback (where you can load up
the next dropdown lists contents). You can handle the change event in there
and handle form submission (as a whole) in some other event.

Of course, all those postbacks can take their toll on a widely-used
application.

"Jon" wrote:
I am using cascading dropdowns, where the selection in one determines what
fills another. In regular ASP I simply loaded a giant dataset into
javascript array and when you clicked on one dropdown, it populated the
others accordingly.

In ASP.Net, I was looking for a way to do this without javascript. So, I
made my form and put code in the SelectedIndexChanged event of the dropdown
that populates the next dropdown. Of course to do this, you have to submit
the form. Is there a way of determining when the form has been truly
submitted and when it's been submitted simply to fill in the next dropdown?
I'm thinking not, but thought I'd ask before I revert to my javascript
method.

Thanks

--
********************************
Jon Rosenberg

Nov 18 '05 #3
Yep, Matt is right. Jon, you can think of it like a VB6 form, where each UI
element can fire it's own method when clicked.

So in asp.net, in the UI you'd have e.g.

<asp:button runat="server" text="Click Me" onclick="mybutton_click" />

and in your code behind you'd have

Sub mybutton_click(Sender as Object, E as EventArgs)
' do something
end sub

So when the user clicks the "Click Me" button on the web page, the
"mybutton_click" function gets executed. You don't have to worry so much
anymore about "truly posted" etc. Just make your UI elements & assign their
actions (onchange, onclick, etc.) to functions, and then code the functions.

For a number of ASP.NET pages, the only time you even care when it's posted
is when you want to initialize some values. And you usually do that in the
Page_Load method with some code like

if not (IsPostBack)
' do some initialization code here that only happens when the user first
hits the page
end if

--
Ben Strackany
www.developmentnow.com

<a href="http://www.developmentnow.com">dn</a>
"MattC" <m@m.com> wrote in message
news:u2**************@TK2MSFTNGP15.phx.gbl...
Jon,

Try not to think of the the form as being trully submitted or not. In
essence to get anything done in ASP.NET you must postback, what determines
what happens is what causes the postback. In your case:

the SelectedIndexChanged event of dropdown one, will cause you to get the
value of the selected item and populate dropdown two based on that value.

Somewhere at the bottom you mayhave a button on the Click event you may then look at the values of the selected items in dropdown lists one and two and
then perform some action.

The need for you to determine when the form has been 'trully' submitted is
done for you by means of which events are fired, if the button is click you then know they want to submit their selections.

MattC

"Jon" <ru******@msn.com> wrote in message
news:10*************@corp.supernews.com...
I am using cascading dropdowns, where the selection in one determines what fills another. In regular ASP I simply loaded a giant dataset into
javascript array and when you clicked on one dropdown, it populated the
others accordingly.

In ASP.Net, I was looking for a way to do this without javascript. So, I made my form and put code in the SelectedIndexChanged event of the

dropdown
that populates the next dropdown. Of course to do this, you have to

submit
the form. Is there a way of determining when the form has been truly
submitted and when it's been submitted simply to fill in the next

dropdown?
I'm thinking not, but thought I'd ask before I revert to my javascript
method.

Thanks

--
********************************
Jon Rosenberg


Nov 18 '05 #4

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

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
1
by: HalaszJ | last post by:
Is there no work around for this? >-----Original Message----- >I have asked this question on about every board I can >think of and I have yet to get an answer, so If anyone >would know I...
3
by: phil2phil | last post by:
hi, had a question on preloading a dropdown. we have a textbox and dropdown on the page, user is suppose to enter in a zip into textbox, then the dropdown should load the state based on the zip. ...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
0
by: Pietje puk | last post by:
Hello, Since im quite new to ASP.NET i wanted to ask you folks what the best way is to create a WebForm for modifying 1 field from a record. The manipulation of this field can be done by using...
4
by: AccessRookie | last post by:
Ok, I am pretty new to Access (Using Access 2002 at my job). Here is what I want to do. I want to create a database that has a form. On this form will be a dropdown menu (combobox). Depending...
5
by: Kassad | last post by:
Two questions: 1. There is a dropdown box that has a whole bunch of values but it is not linked to a recordsource. I believe when this object was created the values were manually enterred but I...
1
by: John Wright | last post by:
I have a dropdown that I load a list of values from a database. If I have more that one value returned from a search I want to populate the dropdown and have the first value be "<Select Run>". ...
4
by: Paul | last post by:
Hi all, I have a page that has a form on it which has a dropdown list on it. It connect to an sql database and populate the list. What I would like to do is make the list editable so that if the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.