Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to display ComboBox in ASP.NET

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to display ComboBox in ASP.NET, Xiaobian thinks it is very practical, so share it with you as a reference, I hope you can gain something after reading this article.

ASP.NET Control Development Skills ComboBox display is how it? First let's take a look at the rendering:

Let's see how it works.

ASP.NET Control Development Skills ComboBox Display Figure 1

ComboBox Features:

In contrast to DropDownList, you can enter text yourself, but HTML does not provide such tags, so you can only use existing tags to simulate.

The screenshot above, let's look at the generated HTML code, this part is partial code. contains two sets.

﹤table id="ComboBox2" class="comboBox" cellpadding="0" cellspacing="0" onmouseout=ComboBox2.HandleInputMouseOut()" onmouseover=ComboBox2.HandleInputMouseOver()" style="display:inline-block;width:200px;"﹥ ﹤tr﹥ ﹤td width="100%" id="ComboBox2_TextBox"﹥ ﹤input id="ComboBox2_Input" name="ComboBox2_Input" autocomplete="off" onsubmit=return false;" type="text" class="comboTextBox" onfocus=ComboBox2.HandleFocus()" onblur=ComboBox2.HandleBlur(event)" onkeydown=ComboBox2.HandleKeyPress(event,this)" style="display:none;" /﹥﹤/td﹥ ﹤td﹥ ﹤img onmouseup=ComboBox2.HandleDropMouseUp(event,this)" onmousedown=ComboBox2.HandleDropClick(event,this)" src="images/drop.gif" id="ComboBox2_DropImage" style="display:block;" /﹥﹤/td﹥ ﹤/tr﹥ ﹤/table﹥ ﹤div class="comboDropDown" id="ComboBox2_DropDown" style="display:none;"﹥ ﹤table cellpadding="0" cellspacing="0" border="0" width="100%"﹥ ﹤tr﹥ ﹤td﹥﹤div id="ComboBox2_DropDownContent" onscroll=ComboBox2.HandleScroll(event,this)" onmousedown=ComponentArt_CancelEvent(event)" onmouseup=ComboBox2.HandleMouseUp(event,this)"﹥ ﹤/div﹥﹤/td﹥ ﹤/tr﹥ ﹤/table﹥ ﹤/div﹥

(1)A table contains a text box and an image. See below.

ASP.NET Control Development Skills ComboBox Display Figure 2

(2)When the image on the right is selected, a drop-down box will appear, that is, the hidden div will appear, you can see that it is initialized to hidden,. see the picture below

ASP.NET Control Development Skills ComboBox Display Figure 3

The two together form a ComboBox control.

About "ASP.NET ComboBox how to display" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report