Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I have created a form using one drop down and one textarea. When i select value from drop down. the text in text area moves one line below. and The cursor in my textarea is not starting at the beginning when clicked to enter text on page load.
But if i remove auto postback="true" from drop down this problem is not occurring. so Let me know if any one know the solution for this Problem.
ASP.NET
  <asp:DropDownList ID="ddlRegItemMainGroupCodeDesc" runat="server" CssClass="ddset" AutoPostBack="true" TabIndex="4" OnSelectedIndexChanged="ddlRegItemMainGroupCodeDesc_SelectedIndexChanged">
</asp:DropDownList>
   <asp:TextBox ID="txtRegSubGroupDescription" runat="server" class="txtfield2" TextMode="MultiLine" onKeyDown="textMaxCounter(this, 200, cphContent_RegSubGroupDescription)" Height="70px" Width="252px">
</asp:TextBox>

C#

C#
protected void ddlRegItemMainGroupCodeDesc_SelectedIndexChanged(object sender, EventArgs e)
      {
          ddlItemMainGroupCodeDesc.SelectedValue = ddlRegItemMainGroupCodeDesc.SelectedValue;
      }
Posted
Updated 25-May-15 0:25am
v6
Comments
abdul subhan mohammed 25-May-15 5:59am    
Plz add code for this " ddlRegItemMainGroupCodeDesc_SelectedIndexChanged " event.

You can use update panel
XML
<asp:UpdatePanel runat="server" ID="YourID">
    <contenttemplate>
        <asp:TextBox ID="txtRegSubGroupDescription" runat="server" class="txtfield2" TextMode="MultiLine" onKeyDown="textMaxCounter(this, 200, cphContent_RegSubGroupDescription)" Height="70px" Width="252px">
        </asp:TextBox>
    </contenttemplate>
</asp:UpdatePanel>
 
Share this answer
 
Even after using update panel i am getting this problem.
 
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