How to make the TextBox readonly or disabled in ASP.NET

This ASP.NET tutorial explains how to make the TextBox readonly or disabled  in ASP.NET.

You can make the TextBox control readonly by setting its ReadOnly property to true. You can set this property in the .aspx page which contains the TextBox control, or programmatically from the code-behind. The next test .aspx page shows this:

ReadOnlyTextBox.aspx

<%@ [...]

How to render a password type textbox in ASP.NET

This ASP.NET tutorial explains how to render a password type textbox in ASP.NET.

You can render the TextBox control to as password type by setting its TextMode property to Password. The next test .aspx page shows this:

TextBoxAsPassword.aspx

<%@ Page Language=”vb” AutoEventWireup=”false” CodeBehind=”TextBoxAsPassword.aspx.vb”

Inherits=”TextBoxSamplesVB.TextBoxAsPassword” %>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>

<head runat=”server”>

<title>Password type [...]

How to indent text with CSS

This ASP.NET tutorial explains how to indent text with CSS.

Sometimes you need to indent text in your web page. In this case you can apply a rule to the container that sets a  padding-left value. You can use the next two files to test this:

 

File test.css

.indent {

padding-left: 40px;

}

 

File test.html

<!DOCTYPE html PUBLIC “-//W3C//DTD [...]

How to specify horizontal rule style with CSS

This ASP.NET tutorial explains how to specify horizontal rule style with CSS.

When your web site includes horizontal rules you can use CSS code to change their color, height and width. In this case for example the CSS code is the following:

File test.css

hr {

border: none;

background-color: #E6E6E6;

color: #000000;

height: [...]

How to change bullets on list items with CSS

This ASP.NET tutorial explains how to change bullets on list items with CSS.

You can use the CSS list-style-type property when you need to specify the style of bullets used in your lists. In the next test file one of the possible options is used.

File test.css

ul {

list-style-type: circle;

}

Note: You can use also one of the [...]

How to change text to all-capitals with CSS

This ASP.NET tutorial explains how to change text to all-capitals with CSS.

You can use the CSS text-transform property when you need to change text to all-capitals.

File test.css

.uppercase

{

text-transform: uppercase;

}

You can use the next file to test:

File test.html

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”

“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml” lang=”en-US”>

<head>

<title>How to change text to all-capitals with CSS</title>

How to justify text with CSS

This ASP.NET tutorial explains how to justify text with CSS.

When you want to justify text you have to alter the spacing between the words so that both the right and left margins are straight. You can use CSS to create this effect.

File test.css

p {

text-align: justify;

font: 14px Arial, Helvetica,Geneva ,Verdana, sans-serif;

line-height: [...]

How to change the line-height on my text with CSS

This ASP.NET tutorial explains how to change the line-height on my text with CSS.

You can use the CSS line-height property when the default space between lines of text box looks a little narrow. The next CSS code shows this.

File test.css

p {

font: 16px Arial, Geneva, Helvetica, sans-serif;

line-height: 2.0;

}

Note: You can [...]

How to highlight text on the page without using font tags with CSS

This ASP.NET tutorial explains how to highlight text on the page without using font tags with CSS.

You can create a class for the highlighting style and apply it by wrapping the highlighted text with <span> tags that apply the class:

1. You can create a CSS .hilite class.

File test.css

body {

font: 1em

Arial, [...]

How to remove all space between a heading and the paragraph that follows it with CSS

This ASP.NET tutorial explains how to remove all space between a heading and the paragraph that follows it with CSS.

Browsers render a gap between heading and paragraph tag, by applying default top and bottom margins to these tags. If you want to remove all space between a heading and the paragraph that follows it, [...]