Thursday, 17 May 2012

Simple TextBox Example - Text Changed Event

Paste Into ASPX Source

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
<form id="form1" runat="server">
<div style="border: 2px; font-size:12px; border-color: Black; border-style: solid; color: White;
background-color: Red; font-weight: bold; font-family: Tahoma"
By : <a href="" style="color:Yellow" target="_search">asp-examples</a>
(Click to get more Examples)
<br />
Author : Akash Parmar<br />
Company Name : Soft-Tech Designs n Development<br />
We Design your Dreams - Develop your Life...
Simple Textbox Example - Textchanged Event - Gets the text from TextBox and Prints in Label...
Enter your name :
<asp:TextBox ID="txtname" runat="server" AutoPostBack="True" OnTextChanged="txtname_TextChanged"></asp:TextBox>
<br />
<br />
<asp:Label ID="lblname" runat="server" Font-Bold="True"></asp:Label>

Paste Into ASPX.CS Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page 
protected void Page_Load(object sender, EventArgs e)
protected void txtname_TextChanged(object sender, EventArgs e)
lblname.Text = "Hello " + txtname.Text;


Albert Andrada said...

Really Nice Information,Thank You Very Much For Sharing.
Web Development Company

Post a Comment

Ranking Website Directory | seo tool | Manoli | ASPDOTNETGUIDE