473,406 Members | 2,745 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,406 software developers and data experts.

DropDownList alternative

I currently have a page that has many dropdowns where each one is
dependent on the previous one's selection. Right now I am using
postbacks on each drop down list to fill the next. An example of what
I am doing would be like having dropdown1 have a list of states. When
the user selects the state it does a postback and fills dropdown2 with
the major cities in that state. This obviously is not a nice
interface. I know Atlas (MS Ajax framework currently in beta) can do
this with callbacks and clean it up. But I have another idea and being
I don't have alot of web background I was wondering if this was a good
idea or if there is unforseen problems that would be caused. I don't
want to spend alot of time getting this to work and then find out it
was a stupid idea.

My idea is to create a control that has a textbox (readonly) a hidden
field and a button (or picture link). When the user clicks on the
button or link, I would add an IFRAME through javascript that would
link to a page that has a asp.net datagrid. I could then provide a
search capability and sorting. The user would click on the item, and
it will fill the textbox, and the hidden field with the ID.

Is there any problems with using the iframe that I am not aware of? Is
this a good idea?

Oct 9 '06 #1
5 2176
I've never actually done anything like this, but I've been developing
in ASP.Net for several years. Here's some feedback for what it's
worth.
1. I assume the IFrame will be filled with content from the same
website and server. Otherwise, there might be security issues.
2. You'll have to work out a way to pass data back & forth between the
containing page and the IFrame. Popping up the IFrame with the correct
list is the easy part, but how will your containing page know which
items you selected in the IFrame? Be careful using Session state to
store this information... you'll need to make sure everything works
even if you have multiple custom-dropdowns on one page.
3. How will your containing page know when you are "done" selecting
items in the IFRAME? This may be a stupid question, but I just can't
picture how it will work.
4. It can sometimes be a pain trying to get the drop-down to work in a
way that doesn't seem "clunky" to your users... click the image, you
get the dropdown. When does the drop-down go away? Under exactly what
circumstances, and can you get it to work in a non-clunky fashion?
5. You mentioned the Atlas stuff. This is actually surprisingly
simple to do. I'm not sure it's in beta any more.
6. Another option is to use "ASP 2.0 Client Callbacks"
7. Another option is to just use the XMLHttpRequest javascript object
(ActiveX Object for IE) yourself, which is what Atlas and Client
Callbacks do behind the scenes.
8. An advantage of what you are proposing is that you could create a
"multi-select" dropdown, which is not available using standard controls
(as far as I know).
9. One more option is to do it the "old school way." Download all
data needed to the client and manipulate everything using javascript
and javascript arrays. This still works really well with smaller data
sets since it eliminates the round-trip all together.

Oct 9 '06 #2
search capability and sorting. The user would click on the item, and
it will fill the textbox, and the hidden field with the ID.

Is there any problems with using the iframe that I am not aware of? Is
this a good idea?
Very much doable.
All code, as would be the case, must be from same domain because
cross-scripting is denied access by all browsers.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
-----------------------------------------
Oct 9 '06 #3
"GroupReader" <ne***********@hotmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
5. You mentioned the Atlas stuff. This is actually surprisingly
simple to do. I'm not sure it's in beta any more.
That would probably be my first choice if the datasets involved are quite
large.
9. One more option is to do it the "old school way." Download all
data needed to the client and manipulate everything using javascript
and javascript arrays. This still works really well with smaller data
sets since it eliminates the round-trip all together.
That would definitely be my first choice if the datasets involved are quite
small.
Oct 9 '06 #4
Thanks for the reply,

The content will come from the same server so this will not be an
issue. I had planned that the IFrame would dissapear when the user
selected an item or I would provide a close icon or link in the IFrame.
As far as filling the fields, I was going to pass the id of the
textbox in the query string of the IFrame and I figured I would be able
to update the textbox from that. I had done similar stuff like that
for dates, I had a calendar icon which opened a new window and when
they selected a date it would close the new window and set the textbox
to the date they selected. One of the big reasons I like the
possibility of this over the Atlas idea is the capability to do a
search. The data that user has to pick from could be rather large
(well over 100 and sometimes close to 500 items). I feel that a
dropdown list with 500 items in it is not that fun to sort through.
That is where I could use the datagrid with paging and a the search
feature to make this more user friendly.

GroupReader wrote:
I've never actually done anything like this, but I've been developing
in ASP.Net for several years. Here's some feedback for what it's
worth.
1. I assume the IFrame will be filled with content from the same
website and server. Otherwise, there might be security issues.
2. You'll have to work out a way to pass data back & forth between the
containing page and the IFrame. Popping up the IFrame with the correct
list is the easy part, but how will your containing page know which
items you selected in the IFrame? Be careful using Session state to
store this information... you'll need to make sure everything works
even if you have multiple custom-dropdowns on one page.
3. How will your containing page know when you are "done" selecting
items in the IFRAME? This may be a stupid question, but I just can't
picture how it will work.
4. It can sometimes be a pain trying to get the drop-down to work in a
way that doesn't seem "clunky" to your users... click the image, you
get the dropdown. When does the drop-down go away? Under exactly what
circumstances, and can you get it to work in a non-clunky fashion?
5. You mentioned the Atlas stuff. This is actually surprisingly
simple to do. I'm not sure it's in beta any more.
6. Another option is to use "ASP 2.0 Client Callbacks"
7. Another option is to just use the XMLHttpRequest javascript object
(ActiveX Object for IE) yourself, which is what Atlas and Client
Callbacks do behind the scenes.
8. An advantage of what you are proposing is that you could create a
"multi-select" dropdown, which is not available using standard controls
(as far as I know).
9. One more option is to do it the "old school way." Download all
data needed to the client and manipulate everything using javascript
and javascript arrays. This still works really well with smaller data
sets since it eliminates the round-trip all together.
Oct 9 '06 #5
using iframes is a standard ajax approach. make the iframe invisible by
setting width and height to 0. an easy wat to do want you want is to render
a select in the iframe. your client code can then copy the options from the
iframe to the selected dropdrown. client code in ca fire the action and
catch the onload (response). its just a couple line of javascript code code.

-- bruce (sqlwork.com)

"Altman" <ba*****@easy-automation.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Thanks for the reply,

The content will come from the same server so this will not be an
issue. I had planned that the IFrame would dissapear when the user
selected an item or I would provide a close icon or link in the IFrame.
As far as filling the fields, I was going to pass the id of the
textbox in the query string of the IFrame and I figured I would be able
to update the textbox from that. I had done similar stuff like that
for dates, I had a calendar icon which opened a new window and when
they selected a date it would close the new window and set the textbox
to the date they selected. One of the big reasons I like the
possibility of this over the Atlas idea is the capability to do a
search. The data that user has to pick from could be rather large
(well over 100 and sometimes close to 500 items). I feel that a
dropdown list with 500 items in it is not that fun to sort through.
That is where I could use the datagrid with paging and a the search
feature to make this more user friendly.

GroupReader wrote:
>I've never actually done anything like this, but I've been developing
in ASP.Net for several years. Here's some feedback for what it's
worth.
1. I assume the IFrame will be filled with content from the same
website and server. Otherwise, there might be security issues.
2. You'll have to work out a way to pass data back & forth between the
containing page and the IFrame. Popping up the IFrame with the correct
list is the easy part, but how will your containing page know which
items you selected in the IFrame? Be careful using Session state to
store this information... you'll need to make sure everything works
even if you have multiple custom-dropdowns on one page.
3. How will your containing page know when you are "done" selecting
items in the IFRAME? This may be a stupid question, but I just can't
picture how it will work.
4. It can sometimes be a pain trying to get the drop-down to work in a
way that doesn't seem "clunky" to your users... click the image, you
get the dropdown. When does the drop-down go away? Under exactly what
circumstances, and can you get it to work in a non-clunky fashion?
5. You mentioned the Atlas stuff. This is actually surprisingly
simple to do. I'm not sure it's in beta any more.
6. Another option is to use "ASP 2.0 Client Callbacks"
7. Another option is to just use the XMLHttpRequest javascript object
(ActiveX Object for IE) yourself, which is what Atlas and Client
Callbacks do behind the scenes.
8. An advantage of what you are proposing is that you could create a
"multi-select" dropdown, which is not available using standard controls
(as far as I know).
9. One more option is to do it the "old school way." Download all
data needed to the client and manipulate everything using javascript
and javascript arrays. This still works really well with smaller data
sets since it eliminates the round-trip all together.

Oct 9 '06 #6

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

Similar topics

12
by: Stanley J Mroczek | last post by:
How do you load a dropdownlist when edit is clicked in a datagrid ? <Columns> <asp:BoundColumn DataField="OptionDescription" ItemStyle-Wrap="True" HeaderText="Option...
2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
2
by: Shiju Poyilil | last post by:
Hello, I have a datagrid with only one row and its having 2 dropdownlists, I need to populate the secodn dropdownlist on the basis of the selection in the first dropdown. but I am not able to...
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: Joe Gass | last post by:
I'd like to bind some xml to a dropdownlist <engines> <engine name="test1" id="1" /> <engine name="test2" id="2" /> </engines> If I do: ddlEngines.DataSource =...
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...
3
by: podi | last post by:
Hi, I just wonder if there is a way to set a selected item in dropdown list which items are retreived from database without touching c# code ? I mean, i have in gridview, in edit mode one...
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: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
0
by: asmx126453 | last post by:
Hey mensen I am having some big troubles here i tryd solving it myself with internet for 2 days but i kind fix it. Its about this i have a DotNet project that alrydi is online and working for...
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: 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
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:
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,...
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.