填充的dropdownList选中的值不是选择悬停值 [英] populated dropdownList selected value is not pick the hover value
本文介绍了填充的dropdownList选中的值不是选择悬停值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<pre lang="css">populated dropdownList selected value is not pick the hover value. Please anybody send any solutions and immediately, thank you
Default.aspx
<li class="form-line" id="id_26">
&lt;label class="form-label-left" id="ddProducts1" for="input_26">
Product
&lt;/label>
<div id="cid_26" class="form-input"> <%--style="left:170px;top:100px;position:absolute" class="dlist" --%>
&lt;label class="dlist">
<asp:DropDownList ID="ddProducts" CssClass="dropdown" runat="server" DataSourceID="sqlproducts"
DataTextField="Product" DataValueField="Product">
</asp:DropDownList>
&lt;/label>
<asp:SqlDataSource ID="sqlproducts" runat="server" ConnectionString="<%$ ConnectionStrings:pmdb %>"
SelectCommand="select 'Type product code' as 'Product' union all select stockCode as 'Product' from productCodes where stockcode like 'AV%' OR stockcode like 'SL%' ">
</asp:SqlDataSource>
</div>
</li>
style.css
.dropdown{
padding:0px; /*-5px 0px 10px 0px;*/
margin: 0;
-webkit-border-radius: 4px #EFEFEF;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
-moz-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset;
background-color: #fff;
/*color: #888;*/
border: 1px solid #ccc;
outline: none;
display: inline-block;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
cursor: pointer;
height: 30px;
}
.dropdown select option{
padding:3px 5px;
color:aqua;
background-color:#ffd800;
padding:-5px 0px 10px 0px;
}
.form-input .form-error-message, .form-input-wide .form-error-message{
bottom:-5px;
font-size:11px;
position:relative;
z-index:900;
right:auto;
top:auto;
color:#333;
padding:3px;
max-width:100%;
padding-bottom:3px;
font-size:12px;
border:none;
-moz-box-shadow:0px 2px 4px rgba(102, 102, 102, 0.5);
-webkit-box-shadow:0px 2px 4px rgba(102, 102, 102, 0.5);
-moz-border-radius:6px 6px;
-webkit-border-radius:6px 6px;
box-shadow:0px 2px 4px rgba(102, 102, 102, 0.5);
border-radius:6px 6px;
background:#FFCCCC;
}
.form-line {
clear:both;
padding:10px;
margin:0px;
/* Changed display to block to prevent a bug in Chrome */
display:block;
width:97%;
width:-moz-available;
/* Removed this because it was changing the size of the migrated forms */
/* border:1px solid transparent ; */
position:relative;
}
.form-line-column{
float:left;
clear:none;
width:auto;
white-space:nowrap;
}
/* Added css rule below to retain display:inline-block for shrunken fields */
.form-line.form-line-column {
display:inline-block;
}
.form-line-column-clear{
clear:left;
width:auto;
}
.dlist {
position: relative;
}
.dlist:after {
/*content: '>';*/
font: 14px "Consolas", monospace;
color: #0081C7;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
right: 8px;
top: -3px;
border-bottom: 1px solid #ddd;
position: absolute;
pointer-events: none;
}
.dlist:before {
/*content: '';*/
right: 6px;
top: -3px;
width: 20px;
height: 20px;
background: #f8f8f8;
position: absolute;
pointer-events: none;
display: block;
}
.form-input {
display:inline-block;
}</pre>
解决方案
ConnectionStrings:pmdb %& gt;& quot;
SelectCommand =& quot; select 'Type product code' as 'Product' union all 选择 stockCode as 'Product'来自 productCodes 其中 stockcode 喜欢'AV%'或 stockcode < span class =code-leadattribute>喜欢'SL%'& quot;& gt;
& lt; / asp:SqlDataSource& gt;
& lt; / div& gt;
& lt; / li& gt;
style 。 css
。下拉 {
padding : 0px; / * - 5px 0px 10px 0px; * /
margin : 0;
- webkit-border-radius : 4px #EFEFEF;
- moz-border-radius : 4px;
border-radius : 4px;
- webkit-box-shadow : 0 3px 0 #ccc,0 -1px #fff inset;
- moz-box-shadow : 0 3px 0 #ccc,0 -1px #fff inset;
box-shadow : 0 3px 0 #ccc,0 -1px #fff inset;
background-color : #fff;
/ * 颜色:#888; * /
border : 1px solid #ccc;
outline : none;
display : inline-block;
- webkit-appearance : none;
- moz-appearance : none;
外观 : none;
cursor : 指针;
height : 30px;
}
。下拉 选择 选项 {
padding : 3px 5px;
颜色 : aqua;
background-color : #ffd800;
padding : - 5px 0px 10px 0px;
}
。 form-input 。 form-error-message ,. form-input-wide 。 form-error-message {
bottom : - 5px;
font-size : < span class =code-keyword> 11px;
position : relative;
z-index < span class =code-keyword>: 900;
right < span class =code-keyword>: auto;
top < span class =code-keyword>: auto;
color < span class =code-keyword>: #333;
padding : 3px;
max-width : 100%;
padding-底部 : 3px;
字体-SI ze : 12px;
border : none;
-moz-box-shadow : 0px 2px 4px rgba(102,102,102,0.5);
- webkit-box-shadow : 0px 2px 4px rgba(102,102,102,0.5);
- moz-border-radius : 6px 6px;
- webkit-border-radius : 6px 6px;
box-shadow : 0px 2px 4px rgba(102,102,102,0.5);
border-radius : 6px 6px;
背景 : #FFCCCC;
}
。 form-line {
clear : both;
padding : 10px;
margin : 0px;
/ * 将显示更改为阻止以防止Chrome中的错误* /
display : block;
width : 97%;
宽度 : - moz-available;
/ * 已移除此项,因为它正在更改已迁移表单的大小* /
/ * border:1px solid transparent; * /
position : 相对;
}
。 form-line-column {
float : left;
clear : none;
width : auto;
white-space : nowrap;
}
/ * 在下面添加了css规则以保留display:inline-block for shrunken fields * /
。 form-line 。 form-line-column {
display : inline-block;
}
。 form-line-column-clear {
清除 : left;
宽度 : auto;
}
。 dlist {
position : relative;
}
。 dlist:after {
/ * content:'& gt;'; * /
< span class =code-attribute> font : 14px& quot; Consolas&am p; quot;,monospace;
颜色 : #0081C7;
- webkit-transform : rotate( 90deg);
- moz-transform : rotate(90deg);
- ms-transform : rotate(90deg);
transform : rotate(90deg);
right : 8px;
top : -3px;
border-bottom : 1px solid #ddd;
position : 绝对值;
指针事件 : none;
}
。 dlist:before {
/ * content:''; * /
right : 6px;
top : -3px;
width : 20px;
height : 20px;
background : #f8f8f8;
位置 : 绝对;
指针事件 : 无;
显示 : block;
}
。 form-input {
display : inline-block;
} < / pre >
ConnectionStrings:pmdb %>" SelectCommand="select 'Type product code' as 'Product' union all select stockCode as 'Product' from productCodes where stockcode like 'AV%' OR stockcode like 'SL%' "> </asp:SqlDataSource> </div> </li> style.css .dropdown{ padding:0px; /*-5px 0px 10px 0px;*/ margin: 0; -webkit-border-radius: 4px #EFEFEF; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset; -moz-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset; box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset; background-color: #fff; /*color: #888;*/ border: 1px solid #ccc; outline: none; display: inline-block; -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; height: 30px; } .dropdown select option{ padding:3px 5px; color:aqua; background-color:#ffd800; padding:-5px 0px 10px 0px; } .form-input .form-error-message, .form-input-wide .form-error-message{ bottom:-5px; font-size:11px; position:relative; z-index:900; right:auto; top:auto; color:#333; padding:3px; max-width:100%; padding-bottom:3px; font-size:12px; border:none; -moz-box-shadow:0px 2px 4px rgba(102, 102, 102, 0.5); -webkit-box-shadow:0px 2px 4px rgba(102, 102, 102, 0.5); -moz-border-radius:6px 6px; -webkit-border-radius:6px 6px; box-shadow:0px 2px 4px rgba(102, 102, 102, 0.5); border-radius:6px 6px; background:#FFCCCC; } .form-line { clear:both; padding:10px; margin:0px; /* Changed display to block to prevent a bug in Chrome */ display:block; width:97%; width:-moz-available; /* Removed this because it was changing the size of the migrated forms */ /* border:1px solid transparent ; */ position:relative; } .form-line-column{ float:left; clear:none; width:auto; white-space:nowrap; } /* Added css rule below to retain display:inline-block for shrunken fields */ .form-line.form-line-column { display:inline-block; } .form-line-column-clear{ clear:left; width:auto; } .dlist { position: relative; } .dlist:after { /*content: '>';*/ font: 14px "Consolas", monospace; color: #0081C7; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); right: 8px; top: -3px; border-bottom: 1px solid #ddd; position: absolute; pointer-events: none; } .dlist:before { /*content: '';*/ right: 6px; top: -3px; width: 20px; height: 20px; background: #f8f8f8; position: absolute; pointer-events: none; display: block; } .form-input { display:inline-block; }</pre>
这篇关于填充的dropdownList选中的值不是选择悬停值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文