See the code below:
Imports System.Web.UI
Public Class TTDefault
Inherits Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Some code goes here
End Sub
End Class
The background compiler generates an Imports statement is unnecessary.
message. If I remove it or comment it out, the background compiler shows no errors. However, when I run, the compiler output says:
5>C:\Work\TimeTrack\TimeTrack\Default.aspx.vb(11,13): error BC30002: Type 'Page' is not defined.
5>C:\Work\TimeTrack\TimeTrack\Default.aspx.vb(13,92): error BC30590: Event 'Load' cannot be found.
...which is what I would expect, considering that the "Imported namespaces" section of the References tab of the project properties has nothing selected. Also, web.config includes this:
<system.web>
<pages>
<namespaces>
<clear/>
</namespaces>
</pages>
</system.web>
How can I get the compilations to match one another?
Also, if I add this into Web.config instead of specifying the Imports statement:
<namespaces>
<add namespace="System.Web.UI"/>
</namespaces>
...I get the same errors when I compile. However, including the imported namespace on the project properties reference page does make it work.