If you're passing a Page, you shouldn't be using the Control type, but the
Page type instead. In fact, you should be passing it as an object of
whatever type you created, inheriting from System.Web.UI.Page. Remember
that pages are objects too, so you can always access its properties simply
by declaring your variable to be of that type.
public class MyPage : System.Web.UI.Page
{
private string s;
public string MyString
{
get { return s; }
}
}
public class MyClass
{
public void PassPage (MyPage page)
{
string s = page.MyString;
}
}
At 10:11 AM 2/28/2003 +0530, S.R.Anand Kumar wrote:
>I have a Page in which i have declared few public properties.
> From this page i am calling a method in another class X by passing this
>page as a Control reference.
>eg. PassPage(this)
>
>Class X {
>...
> PassPage (Control page){
> access the properties of the passed page... and do something
> }
>...
>}
::::::::::::::::::::::::::::::::::
Howard Cheng
http://www.howcheng.com/
howcheng at ix dot netcom dot com
AIM: bennyphoebe
ICQ: 47319315