Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2004

Tip: Looking for answers? Try searching our database.

Error with GUI HTML designer using a custom base code-behind class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fm@newsgroups.nospam - 04 Aug 2004 00:13 GMT
I was working on converting an example pattern from C# to VB.NET for Page Controller in http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html
/EspServicesPatterns.asp
 (Web Service Patterns) when I ran into a nasty bug. I have not tried just setting up a project with their C# to see if it works. We are a VB shop and I'd like to make a case for using this pattern. But not if there is some weird sequence to get it to work.

1) I create a web app project.

2) I add a vb class file with this code:
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Public Class BasePage
   Inherits System.Web.UI.Page

End Class

3) I build the solution.

4) I go to the code behind page of WebForm1.aspx and change the Inherited class from System.Web.UI.Page to BasePage

5) I switch over to the designer page and I receive the following error:
The designer could not be shown for this file because none of the classes within it can be designed.  The designer inspected the following classes in the file:

    WebForm1 --- The base class 'PageController.BasePage' could not be loaded.  Ensure the assembly has been referenced or built if it is part of the project.

Thanks!
Jakob Christensen - 04 Aug 2004 07:49 GMT
Try building your project and afterwards it will work just fine.  Naturally, the design view does not work for a base class that does not yet exist.  A better solution would be to put BaseClass in another assemly and then reference this assembly.

Regards, Jakob.

> I was working on converting an example pattern from C# to VB.NET for Page Controller in http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html
/EspServicesPatterns.asp
 (Web Service Patterns) when I ran into a nasty bug. I have not tried just setting up a project with their C# to see if it works. We are a VB shop and I'd like to make a case for using this pattern. But not if there is some weird sequence to get it to work.
>
[quoted text clipped - 20 lines]
>
> Thanks!
Steven Cheng[MSFT] - 04 Aug 2004 08:08 GMT
Hi,

As for the error you encountered when trying view a webpage indesignvidw
which is derived from a custom base page class(inherit System.Web.UI.Page),
I think Jakob's suggestion is reasonable. And I've also done a test on
myside. Are you put the custom base page class's source file(class.vb)
together with the other pages and codebehinds in the web project? If so,
you need to build the web project first so as to make the base page class
existing in the web project's main assembly. If not, since the VS.NET can't
find the class in the existing asemlies so when try lanuch an instance of
the base class when we swtich into design-view you'll get the error.
In addition, you can also try create another class library project to
centralize all the base classes and build them into assembly separatly and
finally reference them by adding the assembly as reference in the web
project.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Signature

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.