Friday 24 August 2012

Beginning .Net : Text wrapping into the multi line textbox in asp.net

There are situation in multi line textbox where you want to wrapping text in textbox and sometimes you not want to wrap text , that text type as it is.
We can achieve this using "Wrap" property. By Default it is true.

In textbox Wrapping means if you entered text more than width of the textbox it will automatically set cursor into next line. In unwrapping if you entered text more than width of the textbox there is one horizontal scrollbar appear below the textbox and your line is continued.

Here is example for this.
In this example you can see that we take two text boxes one is "Product Description" and Second is "Product Meta Description". And both this text boxes are multiline textbox.
In "Product Description" textbox we allow warp text in this textbox.
And in "Product Meta Description" textbox we do not allow wraping in text.

You can see in output that in "Product Description" textbox new line created without pressing enter or return key. In "Product Meta Description" textbox scrollbar is appear when entered more data.

ASPX Code :
        <table>
            <tr>
                <td>
                    Product Description :
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtProductDescription" TextMode="MultiLine" Wrap="true"
                        Height="120px" Width="250px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Product Meta Description :
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtProductMetaDescription" TextMode="MultiLine" Wrap="false"
                        Height="120px" Width="250px"></asp:TextBox>
                </td>
            </tr>
        </table>

Output : 
(To view original image , click on image)

Here is example for set Maximum characters length of multi line textbox. Click Here...
 
For Beginning .Net articles. Click Here...
 
Here is very useful .Net Tips.


Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.


32 comments:

  1. Nice article to read.Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    selenium training in chennai

    ReplyDelete
  2. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    uipath training in bangalore

    ReplyDelete
  3. This blog gives very important info about .Net Thanks for sharing
    Dot Net Online Training Hyderabad

    ReplyDelete
  4. Thanks first of all for the useful info.
    the idea in this article is quite different and innovative please update more.
    vmware Training in Nungambakkam
    vmware Training in Vadapalani
    vmware Training in Mogappair
    vmware Training in Thirumangalam

    ReplyDelete
  5. I just needed to record a speedy word to express profound gratitude to you for those magnificent tips and clues you are appearing on this site.
    iosh course in chennai

    ReplyDelete
  6. Thank you for sharing such great information very useful to us.
    CCNA Training in Gurgaon

    ReplyDelete
  7. Thanks for sharing your informative post on development.Your work is very good and I appreciate you and hoping for some more informative posts.keep writing
    and sharing.
    R Programming Training in Chennai

    ReplyDelete
  8. If more people that write articles really concerned themselves with writing great content like you, more readers would be interested in their writings. Thank you for caring about your content.
    Webdesign

    ReplyDelete
  9. Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..

    sap fico online training

    sap fico tutorial

    ReplyDelete
  10. 360DigiTMG, Indore is a leading solutions provider of Training and Consulting to assist students, professionals by delivering top-notch, world-class classroom and online training. It offers courses in artificial intelligence course in indore.

    ReplyDelete
  11. It has been a decade that open source platform Linux is dominating the IT industry. Linux servers and desktop operating system is available at cheap prices or pre-loaded offers. machine learning courses in hyderabad

    ReplyDelete
  12. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful.
    360 DigiTMG data analytics course

    ReplyDelete
  13. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! Primavera Course in Chennai | Primavera online course

    ReplyDelete