How will U encapsulate button trigger event into text_box
event of Pressing Enter key?i.e only after pressing Enter
after the text is typed the button trigger event should
activate?

Answer Posted / srinu

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server" >
<div>
<asp:Button ID="Button1" runat="server"
Text="Button" onclick="Button1_Click" />
<asp:TextBox ID="TextBox1" runat="server"
ontextchanged="Button1_Click"></asp:TextBox>
<asp:Label ID="Label1" runat="server"
Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
-------------------------
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "change";
}

if please answer is correct or wrong please inform

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is serialization and deserialization in c# with example?

646


What is the use of static members with example using c#.net.

679


Why are local variables stored in stack?

755


Is friend a constructor?

677


What is a protected class c#?

660


What are the advantages of generics in c#?

681


What is the use of 0 in c#?

712


What is the purpose of constructor in c#?

617


In which way you can convert a value-type to a reference-type?

701


Explain states of a thread in c#?

733


What is the difference between private and protected in c#?

671


What is the difference between const and readonly in c#.net?

689


Explain the types of assemblies in .net?

701


What are native functions?

644


What is private constructor c#?

678