Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling button click method from another control
Message
From
27/06/2008 19:44:02
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01327390
Message ID:
01327409
Views:
9
This message has been marked as the solution to the initial question of the thread.
Hi Linda,

>I have a form which has a variety of criteria a user can enter for locating a particular record. If they enter a specific id, I would like to go ahead and fire the click method of the button to locate a record. It seems like it should be obvious to me but I can't figure out what parameters to pass to the click method. I tried passing the arguments that were passed to the Leave method of the text box but that did not work. Can anyone help with this? Thanks.

It would be better to factor the code in the button click out so you can call it from other places.
private void btnGetRecords_Click(sender object, EventArgs e)
{
     // Move all your code here to the GetRecords method
     this.GetRecords()
}

private void GetRecords()
{
     // Put all your code that was in the click event here so you can call it from multiple places
}
Hope that helps and answers your question
Tim
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform