I have been building a simple ASP.NET application as an exercise. I have a single stand-alone .ASPX page with mixed HTML and in-line VB code. I have been using Visual Studio 2005 to edit the file which I had placed under an existing web site on the local host.
I decided that it was all getting a bit unwieldy and thought it was time to separate out the code. I initially attempted this using #includes but hit some problems. I then stumbled across the Code Behind concept. I therefore altered the line:
to
having moved the VB code into the .vb file and wrapped the code within that file in a Consultant class.
I am getting an error in the trimmed down .aspx file suggesting "'Context' is not a member of 'Consultant'" on the modified line above. Can anyone shed any light?
I decided that it was all getting a bit unwieldy and thought it was time to separate out the code. I initially attempted this using #includes but hit some problems. I then stumbled across the Code Behind concept. I therefore altered the line:
Code:
<%@ Page Language="VB" Debug="true" CompilerOptions='/R:"C:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"'%>
Code:
<%@ Page Language="VB" Debug="true" CompilerOptions='/R:"C:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"' CodeFile="consultant.aspx.vb" Inherits="consultant"%>
I am getting an error in the trimmed down .aspx file suggesting "'Context' is not a member of 'Consultant'" on the modified line above. Can anyone shed any light?