Click or drag to resize
KaxTextBoxAutoCompleteType Property
Gets or sets a value that indicates the AutoComplete behavior of the KaxTextBox control

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public virtual AutoCompleteType AutoCompleteType { get; set; }

Property Value

Type: AutoCompleteType
One of the System.Web.UI.WebControls.AutoCompleteType enumeration values, indicating the AutoComplete behavior for the KaxTextBox control. The default value is None.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionThe selected value is not one of the System.Web.UI.WebControls.AutoCompleteType enumeration values.
Remarks

To assist with data entry, Microsoft Internet Explorer 5 and later and Netscape support a feature called AutoComplete. AutoComplete monitors a KaxTextBox and creates a list of values entered by the user. When the user returns to the KaxTextBox at a later time, the list is displayed. Instead of retyping a previously entered value, the user can simply select the value from this list. Use the AutoCompleteType property to control the behavior of the AutoComplete feature for a KaxTextBox control. The System.Web.UI.WebControls.AutoCompleteType enumeration is used to represent the values that you can apply to the AutoCompleteType property. Not all browsers support the AutoComplete feature. Check with your browser to determine compatibility.

By default, the AutoCompleteType property for a KaxTextBox control is set to AutoCompleteType.None. With this setting, the KaxTextBox control shares the list with other KaxTextBox controls with the same ID property across different pages. You can also share a list between KaxTextBox controls based on a category, instead of an ID property. When you set the AutoCompleteType property to one of the category values (such as AutoCompleteType.FirstName, AutoCompleteType.LastName, and so on), all KaxTextBox controls with the same category share the same list. You can disable the AutoComplete feature for a KaxTextBox control by setting the AutoCompleteType property to AutoCompleteType.Disabled.

Refer to your browser documentation for details on configuring and enabling the AutoComplete feature. For example, to enable the AutoComplete feature in Internet Explorer version 5 or later, select Internet Options from the Tools menu, and then select the Content tab. Click the AutoComplete button to view and modify the various browser options for the AutoComplete feature.

This property cannot be set by themes or style sheet themes.

Examples

The following code example demonstrates how to use the AutoCompleteType enumeration to specify the AutoComplete category for a KaxTextBox control. This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements.

[C#]

            </%@ Page Language="C#" /%>

</%@ Register Assembly="KaxInput.Net2" Namespace="Kettic.AspNetControls" TagPrefix="kaxI" /%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head1" runat="server">
<title>AutoCompleteType example</title>
</head>
<body>
<form id="form1" runat="server">
<!-- You need to enable the AutoComplete feature on -->
<!-- a browser that supports it (such as Internet -->
<!-- Explorer 5.0 and later) for this sample to -->
<!-- work. The AutoComplete lists are created after -->
<!-- the Submit button is clicked. -->
<h3>
AutoCompleteType example</h3>
Enter values in the text boxes and click the Submit
<br />
button.
<br />
<br />
<!-- The following TextBox controls have different -->
<!-- categories assigned to their AutoCompleteType -->
<!-- properties. -->
First Name:<br />
<kaxI:KaxTextBox ID="FirstNameTextBox" AutoCompleteType="FirstName" runat="server" />
<br />
Last Name:<br />
<kaxI:KaxTextBox ID="LastNameTextBox" AutoCompleteType="LastName" runat="server" />
<br />
Email:<br />
<kaxI:KaxTextBox ID="EmailTextBox" AutoCompleteType="Email" runat="server" />
<br />
<!-- The following TextBox controls have the same -->
<!-- categories assigned to their AutoCompleteType -->
<!-- properties. They share the same AutoComplete -->
<!-- list. -->
Phone Line #1:<br />
<kaxI:KaxTextBox ID="Phone1TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />
Phone Line #2:<br />
<kaxI:KaxTextBox ID="Phone2TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />
<!-- The following TextBox control has its -->
<!-- AutoCompleteType property set to -->
<!-- AutoCompleteType.None. All TextBox controls -->
<!-- with the same ID across different pages share -->
<!-- the same AutoComplete list. -->
Category:<br />
<kaxI:KaxTextBox ID="CategoryTextBox" AutoCompleteType="None" runat="server" />
<br />
<!-- The following TextBox control has the -->
<!-- AutoComplete feature disabled. -->
Comments:<br />
<kaxI:KaxTextBox ID="CommentsTextBox" AutoCompleteType="Disabled" runat="server" />
<br />
<br />
<br />
<asp:Button ID="SubmitButton" Text="Submit" runat="Server" />
</form>
</body>
</html>

[Visual Basic]

            </%@ Page Language="VB" /%>

</%@ Register Assembly="KaxInput.Net2" Namespace="Kettic.AspNetControls" TagPrefix="kaxI" /%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head1" runat="server">
<title>AutoCompleteType example</title>
</head>
<body>
<form id="form1" runat="server">
<!-- You need to enable the AutoComplete feature on -->
<!-- a browser that supports it (such as Internet -->
<!-- Explorer 5.0 and later) for this sample to -->
<!-- work. The AutoComplete lists are created after -->
<!-- the Submit button is clicked. -->
<h3>
AutoCompleteType example</h3>
Enter values in the text boxes and click the Submit
<br />
button.
<br />
<br />
<!-- The following TextBox controls have different -->
<!-- categories assigned to their AutoCompleteType -->
<!-- properties. -->
First Name:<br />
<kaxI:KaxTextBox ID="FirstNameTextBox" AutoCompleteType="FirstName" runat="server" />
<br />
Last Name:<br />
<kaxI:KaxTextBox ID="LastNameTextBox" AutoCompleteType="LastName" runat="server" />
<br />
Email:<br />
<kaxI:KaxTextBox ID="EmailTextBox" AutoCompleteType="Email" runat="server" />
<br />
<!-- The following TextBox controls have the same -->
<!-- categories assigned to their AutoCompleteType -->
<!-- properties. They share the same AutoComplete -->
<!-- list. -->
Phone Line #1:<br />
<kaxI:KaxTextBox ID="Phone1TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />
Phone Line #2:<br />
<kaxI:KaxTextBox ID="Phone2TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />
<!-- The following TextBox control has its -->
<!-- AutoCompleteType property set to -->
<!-- AutoCompleteType.None. All TextBox controls -->
<!-- with the same ID across different pages share -->
<!-- the same AutoComplete list. -->
Category:<br />
<kaxI:KaxTextBox ID="CategoryTextBox" AutoCompleteType="None" runat="server" />
<br />
<!-- The following TextBox control has the -->
<!-- AutoComplete feature disabled. -->
Comments:<br />
<kaxI:KaxTextBox ID="CommentsTextBox" AutoCompleteType="Disabled" runat="server" />
<br />
<br />
<br />
<asp:Button ID="SubmitButton" Text="Submit" runat="Server" />
</form>
</body>
</html>
See Also