user control needs data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
i have a simple web page that has one DropDownList that contains employees.
The page also has a WebUserControl that displays a GridView of records
related to the DropDownList.SelectedValue.

On the PageLoad of my web page how can i get the DropDownList.SelectedValue
(which is the EmployeeID) into the WebUserControl so i can set the SQL Select
statement to pull in the records for the correct EmployeeID?

thanks,
rodchar
 
Can't you just make a public method "PopulateData (int userId)" on your
UserControl?
Peter
 
Create a property to get the data in. You can then do whatever you want with
the value.

You may have to create a private variable for the control, as it is not
always created when you drop the control on a page (esp. in 1.x)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

********************************************
Think outside the box!
********************************************
 
Does this Property go into the UserControl? My understanding is that the User
Control wants to get the Data from the page. I don't quite get how to do
this from what I see here.
 
Back
Top