On my master page , I have “Search textbox” and “Search Button”.
On My content page , I have a “User Control” which has a “GridView”.It shows some data about Vendors.
Also, on this User Control’s Page Load, i have code written to display all vendors in GridView.
Now, when user enters Vendor Number in “Search textbox” , and hits “Search Button” , i want to handle this event inside my User Control.
How to do this ?
Please help me. Thanks in advance.
Note : i know how to handle the event in content page but not sure how to handle it inside user control placed on content page.
You just need to add logic that passes in the Search Parameters to the User Control.
On the User Control, make a public method to Bind the grid that takes in the search text
Then, on the MasterPage, you should have something like
You just need to make sure that your UserControl doesn’t bind data on the PageLoad event if IsPostBack is true. Otherwise, you’ll be binding data twice.