Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?

Answers were Sorted based on User's Feedback



How will U encapsulate button trigger event into text_box event of Pressing Enter key?i.e only aft..

Answer / zaid

hmmm nice question asked isn't it??


the answer for dis is that:

jst set the Accept Button property = the button which u want to encapsulate of the Form in which u are doing this
encapsulation .

!!!!!!!!

Is This Answer Correct ?    3 Yes 1 No

How will U encapsulate button trigger event into text_box event of Pressing Enter key?i.e only aft..

Answer / kanimozhi

In Asp.net,
<form id="form1" runat="server" defaultbutton="button name">;

Is This Answer Correct ?    3 Yes 2 No

How will U encapsulate button trigger event into text_box event of Pressing Enter key?i.e only aft..

Answer / 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

How will U encapsulate button trigger event into text_box event of Pressing Enter key?i.e only aft..

Answer / varun sharma

This should possibly do the trick for purpose

protected void Button1_KeyDown(object sender, EventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
Button_Click(null, null);
}
}


protected void Button_Click(object sender, EventArgs e)
{

}

Is This Answer Correct ?    1 Yes 0 No

How will U encapsulate button trigger event into text_box event of Pressing Enter key?i.e only aft..

Answer / sandipan

Your question is not exactly cleat to me !
But then also assuming your ques i am answering this
[ I THINK YOU WANT TO CAPTURE BUTTON CLICK EVENT WITH ENTER KEY ]

protected void Button1_KeyDown(object sender, EventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
///do your stuff
}
}

REPLY YOUR FEEDBACK !!

Is This Answer Correct ?    0 Yes 0 No

How will U encapsulate button trigger event into text_box event of Pressing Enter key?i.e only aft..

Answer / zaid_king

Test ur skills & answer if u can!

Is This Answer Correct ?    5 Yes 11 No

Post New Answer

More C Sharp Interview Questions

What is application object in c#?

0 Answers  


How big is int16?

0 Answers  


What do multicast delegates mean?

0 Answers  


What is Asynchronous call and how it can be implemented using delegates?

0 Answers  


What?s the difference between the System.Array.CopyTo() and System.Array.Clone()?

3 Answers  


How to make a class not inheritable other than sealed?

3 Answers  


What does int32 mean in c#?

0 Answers  


In c#.Net Application For DataGridview binding which method is faster in below two case?Why..? 1)looping-Using For loop 2)Databinding direct using Dataset

4 Answers   CTS,


In how many ways you can overload a method?

0 Answers   Siebel,


Explain what are three test cases you should go through in unit testing?

0 Answers  


WHAT ARE Design Patterns USING IN DOTNET

3 Answers   HP,


What is extension method in c# and how to use them?

0 Answers  


Categories