Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

XML
<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">
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
            &nbsp;</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>
Posted
v3
Comments
Lakshmimsridhar 6-Aug-13 6:12am    
Tadit dash please help me. how to solve above problem
Harshil_Raval 6-Aug-13 7:03am    
Hi, you are binding dropdown on load or on event of any other control. Please specify.
Lakshmimsridhar 6-Aug-13 7:13am    
on page load i am binding it.

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
LoadDropDown();
}

1 solution

call your LoadDropDown() function to Databound event of dropdownlist.

C#
protected void DropDownList1_DataBound(object sender, EventArgs e)
       {
          LoadDropDown();
       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900