1 Attachment(s)
get error in IDE when try to view ASPX designer page *RESOLVED*
Error: "The file could not be loaded into the web forms designer"
I have a class called ApplesBase:
VB Code:
Public Class ApplesBase
Inherits System.Web.UI.Page
Public Sub New()
Call LinkToApples
End Sub
Private Sub LinkToApples()
'code here to do stuff
End Sub
End Class
My web pages now inherit from this:
VB Code:
Public Class EnteringSite
Inherits ApplesBase
'code for web page
End Class
Now the problem occurs when I try to view the designer in the IDE for any web page that inherits ApplesBase.
The error I am getting is in the screenshot.
If I remark out the Call LinkToApples line from the ApplesBase class then it works. but I need this code here.
The problem is that adding break points doesn't help as it seems to not link the code to the IDE, or something.
Anyways, I have been told that I can do an If blah Then type statement in my New sub so that I can only execute the code when not running in the IDE.
Make sense???
Woof
Re: Web Page inherits a class, but get error in IDE when try to view ASPX designer page.
Fixed it.
VB Code:
Public Sub New()
Dim DesignMode As Boolean = (HttpContext.Current Is Nothing)
If Not DesignMode Then
Call LinkToApples()
End If
End Sub
Using the above in ApplesBase class means the code doesn't get executed at design time.
Woka