create a web form or user control but can't see it in code - ASP.net 2.0

Discussion in 'ASP .Net' started by Vahid Dadashzadeh, Jul 6, 2006.

  1. hi,
    i've created a new web form or user control in asp.net 2.0, but i try
    to see it in my codes and when i try to convert an object to the web
    form, i can't see it like there is no webform with that name. for
    example this code below :

    _Default parentPage = (_Default)this.Page;

    in the code above, i assume that i have user control and i want to get
    reference to Page object from this usercontrol and my web form class
    name is _Default, but compiler can't find class by the name of
    _Default.
    this problem is in asp.net 2.0.
    can someone tell me what to do ?
     
    Vahid Dadashzadeh, Jul 6, 2006
    #1
    1. Advertising

  2. This is because of the new compilation model in 2.0. There's a 2003 project
    model for 2005 available at:
    http://webproject.scottgu.com/

    Otherwise, you can add a @Reference directive atop your page to get access
    to the type. Something like
    <%@ Reference Page="~/whatever.aspx" %> and then you'll have access to the
    class of the whatever.aspx page.

    Finally, you can create a base class in the App_Code folder, and reference
    that.

    Karl

    --
    http://www.openmymind.net/



    "Vahid Dadashzadeh" <> wrote in message
    news:...
    > hi,
    > i've created a new web form or user control in asp.net 2.0, but i try
    > to see it in my codes and when i try to convert an object to the web
    > form, i can't see it like there is no webform with that name. for
    > example this code below :
    >
    > _Default parentPage = (_Default)this.Page;
    >
    > in the code above, i assume that i have user control and i want to get
    > reference to Page object from this usercontrol and my web form class
    > name is _Default, but compiler can't find class by the name of
    > _Default.
    > this problem is in asp.net 2.0.
    > can someone tell me what to do ?
    >
     
    Karl Seguin [MVP], Jul 6, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ABC
    Replies:
    1
    Views:
    2,675
    Larry
    Oct 4, 2005
  2. ABC
    Replies:
    0
    Views:
    505
  3. =?Utf-8?B?R2hhbmFzaHlhbQ==?=

    Not able to see ASP.NET web form control in IE 6.0 of 2003 Server

    =?Utf-8?B?R2hhbmFzaHlhbQ==?=, Mar 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    366
    =?Utf-8?B?R2hhbmFzaHlhbQ==?=
    Mar 15, 2006
  4. Flip
    Replies:
    3
    Views:
    1,003
    Tony Morris
    Feb 9, 2004
  5. Steve Kershaw
    Replies:
    1
    Views:
    392
    Brennan Stehling
    Sep 26, 2006
Loading...

Share This Page