How to pass page in Class

  • Thread starter Thread starter Madison
  • Start date Start date
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.
 
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.

--
Gregory A. Beamer
MVP; MCP: +I, Se, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

*************************************************
| Think outside the box! |
*************************************************
 
Back
Top