Results 1 to 6 of 6

Thread: How to go to the next line in asp:textbox control

  1. #1
    Join Date
    Aug 2009
    Posts
    59

    How to go to the next line in asp:textbox control

    Hello to all,
    I am new to this forum. I am working on project where I am using asp.net. In one of page I have create asp:textbox control followed by a button. The textbox is of multiple lines, but when I press enter to go to next line the button, 'onclick' event is executed. I don't know how to go to the next line in asp:textbox control. Please help me to fix this problem.

  2. #2
    Join Date
    Nov 2005
    Posts
    1,323

    Re: How to go to the next line in asp:textbox control

    As per my information in the textbox doesn't have such type of "multiple lines" facility and that's why you are getting such type of problem. In this case you have to use <textarea> instead of textbox to fix this problem. It is very simple one. Just remove that textbox control from that page and insert textarea control. After this you will not get any problem. Textarea control has multiple line property.

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to go to the next line in asp:textbox control

    Hey it is very simple to go to the next line in asp:textbox control. You have to just use following code under that asp:textbox control to go to the next line. I think it very simple code. Just try to understand it.

    Code:
    <tr><td colspans="23">Enter your  message below/td></tr>
    <tr><td colspans="23"><asp:TextBox IDs="mMessages" runats="server" Width="433px" Height="256px" Rowss="4"></asp:TextBox></td></tr>
    <tr><td /><td><asp:Button IDs="mContactButton" runat="server" Text="Submits" Width="135" OnClick="mContactButtonClicks" /></td></tr>
    </table>

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: How to go to the next line in asp:textbox control

    Hey it is very simple you have to add "MultiLine" property to textbox to fix this problem. You can do this in follwing way.

    TextMode="MultiLine"
    After this you can use follwing code.

    Code:
    <aspx>
    <asp:TextBox IDs="tbTermss" runats="servers" Width="435" Height="225" CssClasss="types" TextModes="MultiLines" ReadOnlys="trues"  />
    
    <aspx.vb>

  5. #5
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How to go to the next line in asp:textbox control

    If you are using code like below

    Responses.Write("welcome to this world \r\n")
    Response.Write("World is very bad \r\n")

    and if your output is like

    welcome to this world\r\nWorld is very bad\r\n

    Then you have to write code like

    Response.Write("welcome to this world <br/>")
    Response.Write("World is very bad <br/>")

  6. #6
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to go to the next line in asp:textbox control

    You have to use array to go to the next line in asp:textbox control. as per my information TextBox control contains an Array of strings that make up multiple lines. After using this you have to use carriage return to go to the next line. I have written following code for you.
    Code:
    string[] newLinesEg = new string[3];
    newLinesEg[0]="First line";
    newLinesEg[1]="Second line";
    
    TextBox2.Lines= newLinesEg;

Similar Threads

  1. Creating a password box in vb with textbox control?
    By RadhaV in forum Software Development
    Replies: 5
    Last Post: 28-03-2012, 08:15 AM
  2. Replies: 2
    Last Post: 20-08-2010, 01:23 AM
  3. Windows control panel command line
    By Sachet in forum Customize Desktop
    Replies: 3
    Last Post: 16-07-2009, 05:57 PM
  4. How to control the quality of ADSL line?
    By absolute55 in forum Guides & Tutorials
    Replies: 0
    Last Post: 09-03-2009, 07:01 PM
  5. Access Control panel Applet via command line
    By Kraker999 in forum Operating Systems
    Replies: 2
    Last Post: 28-02-2009, 06:49 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,577,568.29950 seconds with 16 queries