How to pass page in Class

M

Madison

Hi All,
I'm using VS 2008 for our web application. I created user control and placed
in the page from the page when user click submit, I will call function in the
class and try to pass page to the class. I cannot refer any control/object in
the page from the function in the class. How can I get the control from
parameter in the function? Thanks.
 
C

Cowboy \(Gregory A. Beamer\)

If you are properly encapsulating your library, you do not want to pass the
page into the routine and pull from it like a property bag. You want to pull
the items from the page class instead and then feed it to your routine.

One solid reason to do this is it allows you to change UIs for your
application (add a WPF or windows version, for example, or even create a SOA
implementation for the method). When you start passing Me or this (the Page
object) into the library, you intimately tie the Page (and ASP.NET) to the
application code in the library.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top