In VS2005 webapplications how can we create an instance of a class in a page (Eg :deafult3.aspx) from another page (deafult2.aspx).In the earliar VS2003 we could create an instace of a page
Eg for page . Webapplication2.aspx
Webapplication2 objpage=new Webapplication2();
but here in VS2005 we can't create like this.
OR
How can we Import a page from another page in VS 2005 ,c#.
how it s possible ???
Hope u respond sooon.
thanks
Arunlal
How to create an Instance of a class ??
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Edward Legaspi3 pointsPosted Jul 2, 2006, 10:23 PM EDT
MyClass myClass = new MyClass(parameters).
Or if the class resides on another project add a reference to that project first
arunlal a44 pointsPosted Jul 3, 2006, 8:02 PM EDT
source code
-----------
page1.aspx
------------
Public class myclass
{
public string test()
{
return "test return";
}
}
Page2.aspx
----------
in the code behind iam not getting the class "myclass" for creating instance of the class.
hope u respond soon.