473,508 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing state of drop down list

is there a way of changing the state of a drop down list to a text box
depending on criteria ?
i could create a drop down list and a text box list in the same posistion
and change the visibility on criteria
- just wondered if there was another way

thanks
Nov 18 '05 #1
3 1374
no, they are two different controls, you can 'transform' one into the other.
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"luna" <lu**@themoon.com> wrote in message
news:GV***************@newsfep1-gui.server.ntli.net...
is there a way of changing the state of a drop down list to a text box
depending on criteria ?
i could create a drop down list and a text box list in the same posistion
and change the visibility on criteria
- just wondered if there was another way

thanks

Nov 18 '05 #2
Sure

// HTML
<form id=frmMain method=post runat="server">
<asp:Panel ID="pnl" Runat="server">
</asp:Panel>
</form>

// Code
private void Page_Load(object sender, System.EventArgs e)
{
if (true)
{
DropDownList list = new DropDownList();
list.Items.Add(new ListItem("text", "1"));
list.Items.Add(new ListItem("text", "2"));
pnl.Controls.Add(list);
}
else
{
TextBox txt = new TextBox();
pnl.Controls.Add(txt);
}
}
Nov 18 '05 #3
You create the controls at run time rather in the design time....

You can try that....

"luna" <lu**@themoon.com> wrote in message
news:GV***************@newsfep1-gui.server.ntli.net...
is there a way of changing the state of a drop down list to a text box
depending on criteria ?
i could create a drop down list and a text box list in the same posistion
and change the visibility on criteria
- just wondered if there was another way

thanks

Nov 18 '05 #4

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

Similar topics

2
11013
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
3
6141
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
13
5210
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
1
1118
by: darrel | last post by:
I'm binding data to a drop down list. Then, via another query, selecting one of the items from that list by default. What I'd like to do is change the text of that particular item as well. Can...
2
12595
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
5
1849
by: Rob Roberts | last post by:
Is there any way to change VS2005 to generate HTML 4.01/Strict instead of XHTML 1.0/Transititional? VS2005 puts a DOCTYPE statement specifying XHTML 1.0/Transitional at the top of every new aspx...
4
9272
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
3
7329
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
5
3916
by: bennever | last post by:
Hi, I plan to use drop down lists to populate team results and will use the standard country/state drop down lists as the base code. The question: how can I populate multiple (5) states from...
0
7223
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
7115
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
7377
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
7489
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
5624
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
5047
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
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1547
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 ...
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.