Dropdownlist不会在udpdatepanel中加载数据 [英] Dropdownlist is not loading data inside the udpdatepanel
本文介绍了Dropdownlist不会在udpdatepanel中加载数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在面板中使用下拉列表和评级控件。下载列表中没有加载数据。下面是我的代码。请检查并帮助我
< asp:UpdatePanel ID = pnlRating runat = 服务器 >
< 触发器 >
< asp:AsyncPostBackTrigger ControlID = ratingControl EventName = 已更改 / >
< / Triggers >
< 触发器 >
< asp:AsyncPostBackTrigger ControlID = DdlStore EventName = SelectedIndexChanged / >
< / Triggers >
< ContentTemplate >
< table width = 50% >
< tr >
< td class = style1 >
选择StoreId < / td >
< td >
< asp:DropDownList ID = DdlStore < span class =code-attribute> EnableViewState = true runat = server AutoPostBack = True
< span class =code-attribute> 高度 = 17px 宽度 = 152px >
< / asp:DropDownList >
< / td >
< / tr >
< tr >
< ; td class < span class =code-keyword> = style1 >
< b > 平均评分:< / b >
< / td >
< td >
< asp:评分 ID = ratingControl runat = server AutoPostBack = true
EmptyStarCssClass = ratingEmpty FilledStarCssClass = ratingFilled
< span class =code-attribute> OnChanged = RatingControlChanged StarCssClass = ratingEmpty
< span class =code-attribute> WaitingStarCssClass = ratingSaved >
< / asp:评分 >
< b >
< asp:Label ID = lbltxt runat = server / >
< / b >
< / td >
< / tr >
< tr >
< td class = style1 >
& nbsp; < / td >
< td >
& nbsp; < / td >
< / tr >
< tr >
< td class = style1 >
& nbsp; < / td >
< td > ;
< asp:按钮 ID = BtnSend runat = server onclick = BtnSend_Click 文字 = 发送
BackColor = #996633 BorderC olor = #CC3300 BorderStyle = Solid < span class =code-attribute> 宽度 = 150px / > ;
< / td >
< / tr >
< / table >
< / ContentTemplate >
< / asp :UpdatePanel >
解决方案
调用您的LoadDropDown( )功能到 Databound 下拉列表事件。
<前lang =cs> 受保护 void DropDownList1_DataBound( object sender,EventArgs e)
{
LoadDropDown();
}
I am using dropdownlist and rating control inside the panel. dropdownlist in not loading data. below is my code. Please check it and help me
<asp:UpdatePanel ID="pnlRating" runat="server">
<Triggers >
<asp:AsyncPostBackTrigger ControlID="ratingControl" EventName="Changed" />
</Triggers>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DdlStore" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<table width="50%">
<tr>
<td class="style1">
Select StoreId</td>
<td>
<asp:DropDownList ID="DdlStore" EnableViewState="true" runat="server" AutoPostBack="True"
Height="17px" Width="152px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="style1">
<b>Average Rating:</b>
</td>
<td>
<asp:Rating ID="ratingControl" runat="server" AutoPostBack="true"
EmptyStarCssClass="ratingEmpty" FilledStarCssClass="ratingFilled"
OnChanged="RatingControlChanged" StarCssClass="ratingEmpty"
WaitingStarCssClass="ratingSaved">
</asp:Rating>
<b>
<asp:Label ID="lbltxt" runat="server" />
</b>
</td>
</tr>
<tr>
<td class="style1">
</td>
<td>
</td>
</tr>
<tr>
<td class="style1">
</td>
<td>
<asp:Button ID="BtnSend" runat="server" onclick="BtnSend_Click" Text="Send"
BackColor="#996633" BorderColor="#CC3300" BorderStyle="Solid" Width="150px" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
解决方案
call your LoadDropDown() function to Databound event of dropdownlist.
protected void DropDownList1_DataBound(object sender, EventArgs e) { LoadDropDown(); }
这篇关于Dropdownlist不会在udpdatepanel中加载数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文