Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Programmatically created control

Status
Not open for further replies.

fusionboy

Programmer
Jul 14, 2003
27
US
Hi,

I'm having a problem accessing a control on PostBack that is created programmatically on Page_Load. It works when the code is in the aspx page, but not when it is in a codebehind dll. Here's the code to access it:
Code:
ListBox box = (ListBox) FindControl("ImageList");
image = box.SelectedValue;
This works if the code is within <script runat="server"> tags in the aspx page, but not from a codebehind. Weird. I know the ListBox control is being created, because I can see it on the page (and in the HTML).

Any ideas?

Thanks!!!
 
Nevermind -- I'm an idiot.

To get the value from that ListBox, I simply need to check the Request object.

Duh.

Sorry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top