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 programmatically set the TextBox value and get the TextBox value in ASP.NET in VB.NET

This ASP.NET tutorial explains how to programmatically set the TextBox value and get the TextBox value in ASP.NET in VB.NET.

The next example uses a test.aspx page named SetAndGetTextBox.aspx which has two asp:Label controls and one asp:TextBox control. In the code behind the local string variable value is use to read in it the system [...]

How to programmatically set the TextBox value and get the TextBox value in ASP.NET in C#

This ASP.NET tutorial explains how to programmatically set the TextBox value and get the TextBox value in ASP.NET in C#.

The next example uses a test.aspx page named SetAndGetTextBox.aspx which has two asp:Label controls and one asp:TextBox control. In the code behind the local string variable value is use to read in it the system [...]

How to write encoded text on the web page in ASP.NET

This ASP.NET tutorial explains how to write encoded text on the web page in ASP.NET.

When you want to write encoded text on the web page you should use the Literal control, because it does support a property that is not supported by the Label control: the Mode property. The property enables you to [...]

How to associate a Label with a TextBox or other Form control in ASP.NET

This ASP.NET tutorial explains how to associate a Label with a TextBox or other Form control in ASP.NET.

The next code shows how you can attach an asp:Label control with the asp:TextBox. In this case when the user clicks the Label the application will focus on the TextBox.

 

TestAssociate.aspx

<%@ Page Language=”vb” AutoEventWireup=”false” CodeBehind=”TestAssociate.aspx.vb” Inherits=”TextChange.TestAssociate” %>

<!DOCTYPE [...]

How to apply CSS style in the Label control from code-behind in ASP.NET in VB.NET

This ASP.NET tutorial explains how to apply CSS style in the Label control from code-behind in ASP.NET in VB.NET.

You can apply CSS style from code behind by accessing the properties of the control with the help of its Id. Most of the CSS styles can be applied using the Font property and its [...]

How to apply CSS style in the Label control from code-behind in ASP.NET in C#

This ASP.NET tutorial explains how to apply CSS style in the Label control from code-behind in ASP.NET in C#.

You can apply CSS style from code behind by accessing the properties of the control with the help of its Id. Most of the CSS styles can be applied using the Font property and its [...]

How to change the text of the Label control from the code-behind in VB.NET

This ASP.NET tutorial explains how to change the text of the Label control from the code-behind in VB.NET.

TestPage (.aspx)

<%@ Page Language=”vb” AutoEventWireup=”false” CodeBehind=”TestPage.aspx.vb” Inherits=”TestChange.TestPage” %>

<!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>Change the text of the Label control from the code-behind</title>

</head>

<body>

<form id=”form1″ runat=”server”>

<div>

<asp:Label ID=”LabelTest” runat=”server” [...]

How to change the text of the Label control from the code-behind in C#

This ASP.NET tutorial explains how to change the text of the Label control from the code-behind in C#.

 

TestPage (.aspx)

<%@ Page Language=”C#” AutoEventWireup=”false” CodeBehind=”TestPage.aspx.cs” Inherits=”TestChange.TestPage” %>

<!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>Change the text of the Label control from the code-behind</title>

</head>

<body>

<form id=”form1″ runat=”server”>

<div>

<asp:Label ID=”LabelTest” runat=”server” Text=”My test label”></asp:Label>