尝试托管网站时,页面后面代码中的业务对象出现错误 [英] I am getting error at business object in code behind page while try to host website

查看:86
本文介绍了尝试托管网站时,页面后面代码中的业务对象出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试托管网站时,页面后面代码中的业务对象出现错误

这是我在页面后面的代码中的代码.

I am getting error at business object in code behind page while try to host website

This is my my code in code behind page.

Bal objb = new Bal();
b.UserName = TextBox1.Text;
b.Password= TextBox2.Text;
b.Insert_Data(b);


在上面,我在"Bal objb = new Bal()"时遇到错误,例如找不到类型或名称空间名称"Bal"(您是否缺少using指令或程序集引用?).
Bal是一个类文件,我将其放在app_code文件夹中.

这是3层网路应用程式.所以,我不知道我在哪里做错了.所以,请提早给我建议.


In above i''m getting error at ''Bal objb = new Bal()'',like The type or namespace name ''Bal'' could not be found (are you missing a using directive or an assembly reference?).
Bal is a class file and i placed it in inside of app_code folder.

This is 3-Tier web application.so,i don''t know where i did mistake.So,please give me suggestion as early as possible.

推荐答案

Bal是一个类文件,我将其放在app_code文件夹中.
1.在发布之前,您是否编译过网站?
2.如果您进行了编译,那么发布网站的方式是什么?
3.您拥有哪种项目类型:Web应用程序项目(WAP)或Web站点项目(WSP)

请查看以下两篇文章,以了解正在发生的事情以及是否缺少某些内容:
App_Code文件夹不适用于Web应用程序项目(WAP) [ ^ ]
ASP.NET网站项目中的共享代码文件夹 [
Bal is a class file and i placed it in inside of app_code folder.
1. Did you compiled your website before publishing?
2. If you did compiled then what was the way you published your website?
3. What project type you have: Web Application Projects (WAPs) OR Web Site Projects (WSPs)

Have a look at the following two articles to see what is happening and if you are missing something:
App_Code folder doesn’t work with Web Application Projects (WAPs)[^]
Shared Code Folders in ASP.NET Web Site Projects [^]


这篇关于尝试托管网站时,页面后面代码中的业务对象出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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