referring instantiating page

A

Aamir Ghanchi

Hi,

would I refer the aspx page from the class which has been instantiated
in that aspx page.

say I have Default.aspx.
In the code page Default.aspx.cs I instantiate a class as
MyClass mc = new MyClass()

and in the constructor or any other method of MyClass I need to refer
the page Default.aspx and its properties/methods. How do I do it. I am
aware of the PreviousPage property which is meant for cross-page
posting.

Any response will be appreciated.
Thanks in advance.
 
M

Muhammad Naveed Yaseen

You may define an interface with signatures of properties and methods
which you need to call from class, inherit your page from that
interface, and pass page instance to class as that interface type and
then call those properties or methods in class.
 

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

Top