"The file failed to load in the Web Form designer. Please correct the following error, then load it again: Visual Studio cannot open a designer for that file because the class within it does not inherit from a class that can be visually designed."
My main page has this at the top:
<%@ Page Language="vb" src="WebForm2.aspx.vb" Inherits="WebForm2"%>
And my code behind page has:
Imports System Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.HtmlControls Imports System.Web.UI.WebControls.DropDownList Imports System.Web.UI.WebControls.Button Imports System.Data Public Class WebForm2 Inherits Page ( also tried Inherits System.Web.UI.Page ) Protected WithEvents DropDownList1 As System.Web.UI.WebControls.DropDownList Protected WithEvents Button1 As System.Web.UI.WebControls.Button
I believe the problem is in the code behind page, because if I change <%@ Page Language="vb" src="WebForm2.aspx.vb" Inherits="WebForm2"%> to <%@ Page Language="vb" %>, there is no problem.
Again any help you can offer would be greatly appreciated. Thank you.
Requires Free Membership to View
When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to provide a unique online resource for developers, architects and development managers tasked with building and maintaining enterprise applications using Visual Basic, C# and the Microsoft .NET platform.
Hannah Smalltree, Editorial DirectorThis was first published in July 2003