Hi friends.........
Am using a one Textarea and Text box and a Button in my application.. whenever i write a text in textbox and click on the button . textbox value is copied to Textarea... This logic i have written in Button_Click event. Now in an situation i dont want to use a button to copy textbox value to Textarea.. i want to copy the textbox value to textarea, whenever i click on the Enter Button in Keyboard. This is like GoogleChat... after writing the text in textbox , i want to Press Enter Key.. not a Button.. How to implement this..

8 Years
Discussion Span
Last Post by kameswari

hey you can use the following code.. it may help u out...

<%@ Page Language="C#" %>
<script runat="server">

protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
Label1.Text = "Start";
TextBox1.Attributes.Add("onkeyup", "rewriteLabel()");

<script type="text/javascript">

function rewriteLabel(){
TextBox1.Text = Label1.text;


<html xmlns="http://www.w3.org/1999/xhtml" >
<head >
<title >test</title>
<form id="form1" runat="server">
<br />
<asp:TextBox ID="TextBox1" runat="server" /><br />
<asp:Label ID="Label1" Runat="server" BorderWidth="1px" />
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.