Okay,
I know to add content dynamically to web page file you can have
something like the following and it would add a whole bunch of <option>
items for the <select> list. How do you dynamically add <optgroup> items
and <options> under them?
TIA!
In ASPX file:
<%@ Page Language="VB" inherits="..." Src="... .vb" AutoEventWireup="False"
%>
....
<select style="WIDTH: 155px" id="lst_Currency" runat="server"></select>
....
In VB file:
Imports ...
Public Class ...
Public Sub Page_Load(sender as Object, e as EventArgs) _
Handles MyBase.Load
If Me.IsPostBack = False
lst_Currency.Items.Add(New ListItem("Euros", "0.6075"))
lst_Currency.Items.Add(New ListItem("Japanese Yen",
"79.7894"))
lst_Currency.Items.Add(New ListItem("US Dollars", "0.7344"))
lst_Currency.Items.Add(New ListItem("Lower Slobovian
Dinars", "733.4939"))
End If
End Sub
End Class 2 3536
default DropDownList doesnt support this.
you can write your custom control to do this which just writes out the
required html.
you can see the difficulty to implement it in DropDownList here http://weblogs.asp.net/asmith/archiv.../30/29846.aspx
Av.
"EEEdiot" <EE*****@hotmail.com> wrote in message
news:ic********************@giganews.com... Okay,
I know to add content dynamically to web page file you can have something like the following and it would add a whole bunch of <option> items for the <select> list. How do you dynamically add <optgroup> items and <options> under them?
TIA!
In ASPX file: <%@ Page Language="VB" inherits="..." Src="... .vb" AutoEventWireup="False" %> ... <select style="WIDTH: 155px" id="lst_Currency" runat="server"></select> ...
In VB file:
Imports ...
Public Class ...
Public Sub Page_Load(sender as Object, e as EventArgs) _ Handles MyBase.Load
If Me.IsPostBack = False lst_Currency.Items.Add(New ListItem("Euros", "0.6075")) lst_Currency.Items.Add(New ListItem("Japanese Yen", "79.7894")) lst_Currency.Items.Add(New ListItem("US Dollars", "0.7344")) lst_Currency.Items.Add(New ListItem("Lower Slobovian Dinars", "733.4939")) End If End Sub End Class
At least, I know.
"avnrao" <av*@newsgroups.com> wrote in message
news:Ou**************@TK2MSFTNGP11.phx.gbl... default DropDownList doesnt support this. you can write your custom control to do this which just writes out the required html.
you can see the difficulty to implement it in DropDownList here http://weblogs.asp.net/asmith/archiv.../30/29846.aspx
Av. "EEEdiot" <EE*****@hotmail.com> wrote in message news:ic********************@giganews.com... Okay,
I know to add content dynamically to web page file you can have something like the following and it would add a whole bunch of <option> items for the <select> list. How do you dynamically add <optgroup>
items and <options> under them?
TIA!
In ASPX file: <%@ Page Language="VB" inherits="..." Src="... .vb" AutoEventWireup="False" %> ... <select style="WIDTH: 155px" id="lst_Currency" runat="server"></select> ...
In VB file:
Imports ...
Public Class ...
Public Sub Page_Load(sender as Object, e as EventArgs) _ Handles MyBase.Load
If Me.IsPostBack = False lst_Currency.Items.Add(New ListItem("Euros", "0.6075")) lst_Currency.Items.Add(New ListItem("Japanese Yen", "79.7894")) lst_Currency.Items.Add(New ListItem("US Dollars", "0.7344")) lst_Currency.Items.Add(New ListItem("Lower Slobovian Dinars", "733.4939")) End If End Sub End Class
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: theo |
last post by:
Program flow...load file,then extract the xml text tags from the
file,then the number of
Xml tags retrieved from the file determines the number of dropdownlist
controls
instanciated in the...
|
by: Reza Solouki |
last post by:
Hello,
I have a dropdown list control, where there are cases that I need to
populate the control from a database and select one of the items in this list
after.
Because the content of this...
|
by: C Downey |
last post by:
I have a registration form that should load different web user controls
based on the selection of a dropdown list. Basically, the user follows the
following steps:
1. user comes to very basic...
|
by: Tobin |
last post by:
I am new to ASP.NET 2.0 and am redesigning some web pages developed in
classic ASP.
A common task was for me to accept input of text boxes and date controls to
provide a filtered list for the...
|
by: justin |
last post by:
I am trying to make a page that has a drop down list at the top, and
based upon the selection in the drop down list, inserts a FormView in
the bottom of the page. I tried to create each of my...
|
by: swapnil1987 |
last post by:
hello friends i am trying to find solution for this problem if u know something then please tell
i am creating web application that runs on black berry.
here i need to create selection list...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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...
|
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...
|
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,...
|
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...
| |