ASP.NET C#中的名称空间名称 [英] namespace name in asp.net c#

查看:91
本文介绍了ASP.NET C#中的名称空间名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net C#上的项目上工作.我有登录页面"Login.aspx".该页面没有主页.我已经创建了dboperation类.并且通过创建dboperation类的对象使用登录页面来使用此类.它正在localhost上运行.然后我上传到我的服务器.但它在"Login.aspx"页面中显示错误.

错误是

I working on project on asp.net C# . i have login page ''Login.aspx''. this page does''nt have master page. i already create dboperation class. and this class using login page by creating object of dboperation class. It is working on localhost. then i upload this to my server. but it shows an error in ''Login.aspx'' page.

The error is

Compiler Error Message: CS0246: The type or namespace name 'Dboperation' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 15: public partial class Login : System.Web.UI.Page
Line 16: {
Line 17:     Dboperation Db = new Dboperation();
Line 18:     string a = "Admin/Principal";
Line 19:     string s = "Students";


请帮助我.


Please help me.

推荐答案

将光标置于代码中的"Dboperation"一词上.你有一条小红线吗?如果是这样,请将鼠标悬停在其上方,然后打开将出现的下拉菜单.您将从VS获得一些可以修复它的选项.
如果没有,则找不到Dboperation-您可能输入的大写错误,可能需要找到DLL,或将适当的.cs文件移动到App_Code文件夹中.
Place the cursor over the word "Dboperation" in your code. Do you get a small red line? If so, hover the mouse over it, and open the dropdown that will appear. You will gets options from VS that will fix it.
If you don''t, then Dboperation can''t be found - you may have got the capitalization wrong, you may need to locate the DLL, or move the appropriate .cs file into the App_Code folder.


对代码中包含类DBoperation missing的名称空间的引用吗?
该类本身也可能会丢失,因此请确保两者都不存在.
Is the reference to namespace that contains class DBoperation missing in your code?
Also the class itself could be missing so make sure its none of the two.


我猜这个Dboperation类位于与Login不同的名称空间中.因此,将其写为:-

Namespace.Dboperation Db =新的Namespace.Dboperation();

并引用项目中Dboperation所在的dll.
I guess this Dboperation class lies within a different Namespace than Login. So, write it as :-

Namespace.Dboperation Db = new Namespace.Dboperation();

and reference the dll in which the Dboperation lies in within your Project.


这篇关于ASP.NET C#中的名称空间名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆