问题描述
我只是一个asp.net web应用项目中创建新的用户控件。
I just created new usercontrol in an asp.net webapplication project.
创建后,源看起来是这样的:
Right after creation, the source looks like this:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SSR_Project.ascx.vb" Inherits="CS_SSR_RAIO.SSR_Project" %>
但只要我添加一些额外的code到它,第一行的错误是immedeately:
But as soon as i add some additional code to it, the error on the first line is immedeately:
上下文不是CS_SSR_RAIO.SSR_Project的成员
我有谁似乎有相同的声明,但是不要有此错误的其他用户控件。
I do have other usercontrols who appear to have the exact same declarations, but dont have this error.
任何帮助将大大AP preciated!
Any help would be greatly appreciated!
推荐答案
我得到这个错误,因为它找不到类我新的用户控件的codebehind的。我有这个,因为我已经复制了用户控件,这是在我没有加入到继承属性正确命名空间。
I got this error because it couldn't find the class of my new usercontrol's codebehind. I had this because I'd copied a usercontrol and it was in a Namespace which I'd not added to the Inherits attribute correctly.
添加了命名空间preFIX,它开始工作了:)
Added the namespace prefix and it started working again :)
这篇关于上下文不是在asp.net用户控件成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!