Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextBox using HTMLEditorExtender does not insert new line when pressing Enter

I am using AjaxToolKit's HTMLEditorExtender control in my website. The markup is as follows:

<asp:TextBox ID="TextBox2" runat="server" 
        Font-Names="'lucida grande',tahoma,verdana,arial,sans-serif" Height="100%" OnTextChanged="TextBox2_TextChanged" 
        style="margin-bottom: 26px; font-size: small;" Width="90%"></asp:TextBox>

<asp:HtmlEditorExtender ID="TextBox2_HtmlEditorExtender" runat="server" 
        Enabled="True" TargetControlID="TextBox2">
    <Toolbar>
        <asp:Undo />
        <asp:Redo />
        <asp:Bold />
        <asp:Italic />
        <asp:Underline />
        <asp:StrikeThrough />
        <asp:Subscript />
        <asp:Superscript />
        <asp:InsertOrderedList />
        <asp:InsertUnorderedList />
        <asp:RemoveFormat />
        <asp:SelectAll />
        <asp:UnSelect />
        <asp:Delete />
        <asp:Cut />
        <asp:Copy />
        <asp:Paste />
        <asp:Indent />
        <asp:Outdent />
        <asp:FontNameSelector />
    </Toolbar>
</asp:HtmlEditorExtender>

Running the application, and pressing Enter while TextBox2 has focus, no new line is inserted; instead, TextBox2 loses focus.

This doesn't happen unless the HTMLEditorExtender is attached to TextBox2.

More Details

I am running the application in local IIS. The website is live but the feature is not launched on the main website yet. I am using ASP.NET WebForms and latest AjaxToolkit version. Also this problem is in every browser including Chrome, IE, Opera, Firefox.

like image 538
Shiva Pareek Avatar asked Mar 02 '13 10:03

Shiva Pareek


1 Answers

Finally I solved the error myself. The code which I provided was enclosed in a Panel that has a default button. So I removed the DefaultButton property and the code is working fine now. Thank you all for adding your responses.

like image 140
Shiva Pareek Avatar answered Nov 15 '22 00:11

Shiva Pareek