Controls belong to the page. The new class knows nothing about the page.
Mixing controls with data access code in the same class is not a good idea.
A better solution is to get the methods of the class return data access
objects like datareaders, datatables, datasets, leave all the controls on
the page and databind the controls to the objects returned from the class.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin http://usableasp.net
<ru******@walla.co.ilwrote in message
news:11*********************@k78g2000cwa.googlegro ups.com...
Hi,
I need a few sql queries results so I created a new class with has a
few functions that load the data.
After executing ExecuteReader, I need to load the data to the
dropdownlist control.
The problem is that the control isn't recognized in the new class
(recognized only in Default.aspx.vb) -none of the controls of
default.aspx is recognized in the new class.
Any idea?
What am I missing?
Thanks.
Ruthie.