Click here to Skip to main content
15,889,597 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using update panel for dropdown to fill textbox. It works fine but the problem is after dropdown selected index change occurs my page design gets changed like the controls in the content template moves top to my page and there occurs duplication of controls in content template makes my design worse. how to resolve it

here is the code
thanks in advance
XML
<tr align="left">
           <td style="width:100%">
                <asp:Label ID="lblFreightType" runat="server" Text="Freight Type: *" CssClass="label" />
            </td>
           <td  style="width:100%;">
                 <asp:DropDownList ID="ddlFreightType" AutoPostBack="true" runat="server" CssClass="dropmenu" OnSelectedIndexChanged="ddlFreightType_SelectedIndexChanged"
                    Width="160px" />
            </td>

         <td style="width:100%">
        <%--        <asp:RequiredFieldValidator ID="rfvFreightType" runat="server" ControlToValidate="ddlFreightType" ErrorMessage="Select the Freight Type" CssClass="label" />--%>
            </td>
       </tr>
       <asp:UpdatePanel ID="upFreightType" runat="server"  UpdateMode="Conditional" >
        <ContentTemplate>
             <tr  align="left">
                <td  style="width:100%;">
                <asp:Label ID="lblQuantity" runat="server" Text="Quantity :" CssClass="label" />
               </td>
            <td  style="width:100%;">
                <asp:TextBox ID="txtQuantity"  runat="server" CssClass="textBox" Text="1" Width="40px" />
                <input type="button" value='-' onclick='javascript:decrement(-1)' />
                <input type="button" value='+' onclick='javascript:increment(1)' />
             </td>
              <td style="width:100%;">
                 <asp:Label ID="lblQuantityPostFix" runat="server" />
            </td>
        </tr>
      <tr align="left">
           <td  style="width:100%;">
                <asp:Label ID="lblBasicAmount" runat="server" Text="Basic Amount:" Enabled="false" CssClass="label" />
            </td>
            <td colspan="2"  style="width:100%;">
                <asp:TextBox ID="txtBasicAmount" runat="server" CssClass="textBox" Width="160px" />
            </td>
       </tr>
      </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ddlFreightType" EventName="SelectedIndexChanged" />
        </Triggers>
        </asp:UpdatePanel>
Posted
Updated 21-Jun-13 22:29pm
v4
Comments
OriginalGriff 22-Jun-13 4:16am    
Please, don't try to write your whole question in the subject - it should be a brief summary only. Otherwise it gets truncated, and nobody knows what you are talking about. As here.
Use the "Improve question" widget to edit your question and provide better information.

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