Thanks for your response but that does not answer my question. What i wanted
to know was how to make the webforms and/or usercontrols visible to each
other.
I figured it out. Simply add an ASP.NET APP_CODE folder to your website and
create a abstract class within it that inherits the Page class. Then add
abstract public variables/objects you want to expose globally. Once you done
that, you have to modify your webform codebehind to inherit from the abstract
class that you created and create the corresponding properties.
Doing this in 1.1 was easy. Just change the modifier for whichever control
you want to expose.
/* this line in 2.0 is hidden from the programmer. I use this in 1.1 mainly
to expose the properties from controls in web user controls. */
public Label lblMsg = new Label();
It's a bit disappointing that i have to write more code now just to expose a
control's properties in an user control to a webform.
Nuno Pereira
"Cowboy (Gregory A. Beamer) - MVP" wrote:
A better option is move the common code to another class so you can call it
from both pages. While you can kludge things up to call webform 2 (different
methods depending on whether this is 1.1 or 2.0), it is, generally, not a
good option and I cannot think of any instance where you cannot move code to
another class alleviating the need for this type of kludge.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
*************** ************
Think Outside the Box!
*************** ************
"Nuno" wrote:
How can I instantiate a webform2 object from webfrom1 codebehind? The class
does not popup in intellisense and gives me and error if i try to create it.
Nuno