Textbox Value Passed As Parameter to Button Click Event

Although I found a similar post, I believe mine is a little different. I have a custom method named GetCustomerByLastName(string custLastName). As you can see, it accepts a single string parameter for the last name of the customer. On my page where I'm displaying a list of customers, I'm wanting to create a search textbox with a button (similar to the CRM demo). I did try to follow but must be missing something as the app fails to run.

What I'm trying to do, is pass the value from the text box as a parameter during the button click event which will invoke the GetCustomerByLastName(string custLastName) method.

Hopefully the screenshots will help.

What does this mean?

Also you don't need to handle the Change event of a TextBox in order to update the Value property. It happens automatically. More info is available in the documentation.

I’m not sure why it says “app fails to run.” The app runs fine. So then, on button click how do I get the text box value to pass into a custom method?

Check the linked help article and this section from the Invoke custom method help article.