JavaScript Editor jscript editor     Web designer 



Main Page

When writing ASP.NET Web pages, the best way to make text flow from right to left is to use the dir (direction) attribute. The dir attribute is usually placed in either the html or body tag, and then controls and HTML elements on the page inherit from the specified direction.

The tag to which the dir attribute is applied affects how the page appears, as follows:

There are other ways to set the flow of text, including the bdo tag for bidirectional override, Unicode characters that have embedded directional information, cascading style sheets, and so on. For more information, go to the Global Development Computing Portal on Microsoft.com and search for information about authoring HTML for middle-eastern content.

To set the dir attribute in an ASP.NET Web page

  1. In the <html> or <body> tag, set dir to ltr or rtl.

    For example:

    В CopyCode imageCopy Code
    <html dir="rtl">
    <!-- Or -->
    <body dir="rtl" >
  2. To override the default direction for individual controls, set dir for each control to ltr or rtl.

    For example:

    В CopyCode imageCopy Code
    <table dir="ltr" >
    <asp:TextBox dir="ltr" >

See Also



JavaScript Editor jscript editor     Web designer