473,513 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox

Hi,

I have an ASP.NET form that includes several combo Boxes.
The first Combo is loaded with items on Page_load.
The second depends on the item selected on the first, the third on the
second and so on.

I don't want to transfer all the data needed with the form and also want to
avoid page refresh on every item change.

What is the best method for doing this?
I heard about xmlhttp and WS but I don't know if any of those technologies
is appropriate and how to use them in the project.

Samples will help me very much.

10X.
Nov 17 '05 #1
2 2539
If I understand you correctly, you've just ruled out the only 2
possibilities you have. Think about it. The data to populate the combo boxes
is stored on the server. Therefore, you either have to (1) pass it all to
the client to avoid having to PostBack, or (2) PostBack to get the data. If
you can think of a third way, you're probably due the Nobel Prize!

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.

"Tamir Berger" <tb*****@kpmg.com> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have an ASP.NET form that includes several combo Boxes.
The first Combo is loaded with items on Page_load.
The second depends on the item selected on the first, the third on the
second and so on.

I don't want to transfer all the data needed with the form and also want to avoid page refresh on every item change.

What is the best method for doing this?
I heard about xmlhttp and WS but I don't know if any of those technologies
is appropriate and how to use them in the project.

Samples will help me very much.

10X.

Nov 17 '05 #2
Hello

you could also use the webservice behavior to obtain the new info and
transorm it with xsl to a <select>. or with the xmlhttp object...

other idea?

"Anatoly" <an******@gilat.com> a écrit dans le message de
news:%2****************@TK2MSFTNGP10.phx.gbl...
We are using a hidden iframe for this
1)Put an IFRAME with style="display:none" in this web form.
2)On combo change(client-side) write something like this:

frmServerSide.location.href =
'serverSide.aspx?Function=FillCompanyCombo&cboRegi on=' +
document.frmCaseList.cboRegion.value + '&defaultCompany=' + defaultCompany;
where frmServerSide is name of IFRAME

3)in serverSide.aspx write on Page_Load() get the appropriate data (in
dataset for example) and do in loop

Response.Write("<script>")
Response.Write( " var oSelect = parent." + ComboName + "; ")
Response.Write( " var oOption; ")
//cleans the combo before filling
Response.Write( " while(oSelect.options.length>0) ")
Response.Write(" oSelect.options.remove(0);")
foreach(DataRow Row in Data.Rows){
Response.Write( " oOption = document.createElement(""OPTION"");")
Response.Write( " oOption.text = '" + Row[TextField].ToString() + "';") Response.Write( " oOption.value = '" + Row[ValueField] + "';")
Response.Write( " oSelect.add(oOption); ")
}

ComboName is DropDownList.ClientId which you may pass from first form

HTH

"Tamir Berger" <tb*****@kpmg.com> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have an ASP.NET form that includes several combo Boxes.
The first Combo is loaded with items on Page_load.
The second depends on the item selected on the first, the third on the
second and so on.

I don't want to transfer all the data needed with the form and also want

to
avoid page refresh on every item change.

What is the best method for doing this?
I heard about xmlhttp and WS but I don't know if any of those technologies is appropriate and how to use them in the project.

Samples will help me very much.

10X.


Nov 17 '05 #3

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

Similar topics

13
2745
by: Mr. B | last post by:
Here's the situation... You've a combobox with Items already added. Say they look like this (or even lines of text): 10-00-232 10-00-256 10-01-006 10-01-213 10-02-200
7
8485
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...
8
12066
by: Zlatko Matiæ | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
2478
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new...
3
6806
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
2
6169
by: Don | last post by:
I've looked high and low for some code that will allow me to have a combobox with a flat borderstyle. I found a few examples, but nothing that was really usable for me. I had the following...
4
4603
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
6
2846
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
1
3357
by: polocar | last post by:
Ciao a tutti, leggendo qua e là per il forum ho scoperto che non sono l'unico ad avere questo problema. Se si inserisce un controllo ComboBox in un form di C#, non è possibile impostare la sua...
5
5887
by: Rich | last post by:
Hello, I have a search application to search data in tables in a database (3 sql server tables). I populate 2 comboboxes with with data from each table. One combobox will contain unique...
0
7177
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
7394
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
7559
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
5701
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,...
1
5100
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...
0
4756
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
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1611
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
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.