Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > create a web form or user control but can't see it in code - ASP.net 2.0

Reply
Thread Tools

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

 
 
Vahid Dadashzadeh
Guest
Posts: n/a
 
      07-06-2006
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 ?

 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      07-06-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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 ?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web User Control with GridView can derive new Web User Control? ABC ASP .Net 1 10-04-2005 12:29 PM
Web User Control with GridView can derive new Web User Control? ABC ASP .Net Web Controls 0 10-03-2005 10:23 AM
Web User Control with GridView can derive new Web User Control? ABC ASP .Net 0 10-03-2005 10:23 AM
Compilation fails when a windows form user control is assigned a strong name but it refers to an activex control which does not have strong name ashish_gokhale ASP .Net Web Controls 0 05-05-2005 01:38 PM



Advertisments