title: CodeFile OK, CodeBehind gives "not declared" error
body: <p>I have an asp project that works fine with CodeFile, but when I change it to CodeBehind, the vb functions are not recognized in the aspx file, giving a "Name ... is not declared" error in the aspx file.</p>
  
  <p>In order to use CodeBehind, is there something else that should be done besides changing <code>codefile</code> to <code>codebehind</code> in the top line?</p>
  
  <p>The following code gets the error "Name 'connex' is not declared," in the aspx file.</p>
  
  <pre><code>&lt;%@ Page Language="vb" AutoEventWireup="false" Codebehind="browse.aspx.vb" Inherits="_browse" %&gt; &lt;!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html&gt;
  &lt;head runat="server"&gt; &lt;title&gt;Test&lt;/title&gt; &lt;/head&gt; 
  &lt;body&gt; 
  &lt;form id="form1" runat="server"&gt;
  &lt;div&gt;
  &lt;%
    Dim s As String = connex()  
    Response.Write(s)
  %&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>==================</p>
  
  <pre><code>Imports System
  Imports System.Web
  
  Partial Public Class _browse
  Inherits System.Web.UI.Page
  
  Function connex() As String
    Return "OK"
  End Function
  
  End Class
  </code></pre>