Name does not exist in the current context

前端 未结 11 1682
时光说笑
时光说笑 2020-12-05 12:34

So, I\'m working on this project between my laptop and my desktop.

The project works on the laptop, but now having copied the updated source code onto the desktop, I

11条回答
  •  鱼传尺愫
    2020-12-05 13:12

    I solved mine by using an Import directive under my Page directive. You may also want to add the namespace to your Inherits attribute of your Page directive.

    Since it appears that your default namespace is "stman.Members", try: <%@ Page Title="" Language="C#" MasterPageFile="~/Members/Members.master" AutoEventWireup="true" CodeFile="Jobs.aspx.cs" Inherits="stman.Members.Members_Jobs" %> <%@ Import Namespace="stman.Members"%>

    Additionally, data that I wanted to pass between aspx.cs and aspx, I put inside a static class inside the namespace. That static class was available to move data around in the name space and no longer has a "not in context" error.

提交回复
热议问题