How to add code behind file to existing page
If you have an existing page that uses code inline and want to associate a code file with it, do the following:
1. Assuming that name of the page is Foo.aspx, create a new code file named Foo.aspx.vb in the same directory.
2. Change page directive to
<%
@ Page Language="VB" AutoEventWireup="false" CodeFile="Foo.aspx.vb" Inherits="Foo" %>
3. Close and reopen the solution or Web site.
The code file should now correctly show up in the Solution Explorer as a subnode of the page file.
Comments
- Anonymous
April 13, 2006
The comment has been removed - Anonymous
July 20, 2006
- Rename file from .htm to .aspx in Solution Explorer 2. On top pf the page add &lt;%@ Page Language="VB"...