Last post Sep 26, 2017 12:48 AM by bbxrider
Sep 25, 2017 05:15 AM|bbxrider|LINK
I have a vs2008 webform that I'm porting to vs2017
In the vs2008 I had both the page/html and logic code in the .aspx did not use the code behind .vb
for vs2017 I separated the page/html code only in the .aspx and moved the logic code into the code behind .aspx.vb
the .vb can't see any of the web form controls in the .aspx
Error BC30451 'addr1Diff' is not declared. It may be inaccessible due to its protection level.
must have followed up on about 15 posts how to solve but not seeing a solution that I can use
declarations in the .aspx
<%@ Page Language="vb" AutoEventWireup="false" Inherits="projectName.programName" CodeFile="~/programName.aspx.vb" CodeBehindFile="~/programName.aspx.vb"%>
declarations in the .vb =
Public Class programName
there must be something in the .aspx declarations that allow the .vb to see its controls??
and when I rebuild project I get a success message?
Sep 25, 2017 07:50 AM|PatriceSc|LINK
This is CodeBehind rather than CodeBehindFile and you are using CodeFile for web site projects and CodeBehind for web application projects. Check perhaps other working pages. Try
https://msdn.microsoft.com/en-us/library/dd547590(v=vs.100).aspx to decide which model you want (AFAIK Web Application projects is preferred much often).
Sep 26, 2017 12:48 AM|bbxrider|LINK
thanks that worked
changing to "CodeBehind=" worked,
and thanks for the heads up on project differences, will take a while to sort that out, looks like this particular project is better suited to the project vs application, its seems this is new distinction that was not there in vs2008