How to use filter textbox extender control in ajax?

aswinialuri-19361
Posted by aswinialuri-19361 under ASP.NET AJAX category on | Points: 40 | Views : 1491
in .aspx code:
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Label
ID="Label1"
runat="server"
ForeColor="OrangeRed"
Font-Size="X-Large"
Height="37px"
></asp:Label>
<br />
<asp:Label
ID="Label2"
runat="server"
ForeColor="DodgerBlue"
Font-Italic="true"
Font-Names="Comic Sans MS"
Font-Size="Large"
Text="Zip Code "
Font-Underline="true"
>
</asp:Label>
<asp:TextBox
ID="TextBox1"
runat="server"
Font-Bold="true"
BackColor="Snow"
ForeColor="DeepPink"
Font-Names="Comic Sans MS"
Font-Size="Medium"
>
</asp:TextBox>

<asp:FilteredTextBoxExtender ID="TextBox1_FilteredTextBoxExtender"
runat="server" Enabled="True" TargetControlID="TextBox1"
FilterType="Numbers"
FilterMode="ValidChars" >
</asp:FilteredTextBoxExtender>
<br /><br />
<asp:Button
ID="Button1"
runat="server"
ForeColor="DodgerBlue"
Font-Bold="true"
Height="40"

Text="Submit ZIP Code" onclick="Button1_Click1"
/>
</div>
</form>
</body>

In .aspx.cs code:

 protected void Button1_Click1(object sender, EventArgs e)
{
Label1.Visible = true;
Label1.Text = "Your ZIP Code: " + TextBox1.Text;
}


you can allow lower case, uppercase,Numbers,Symbols nby filter mode
FilterMode="UppercaseLetters, LowercaseLetters"

I hope you will understand this

Comments or Responses

Login to post response