在ASP.NET中导入类 [英] Import a class in ASP.NET

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

问题描述

我想导入App_Code中的类以在我的aspx页面中使用它.

I want to import a class that is in App_Code to use it in my aspx pages.

我该怎么办?

谢谢

推荐答案

将您使用的命名空间添加到代码隐藏文件或aspx文件中(如果不使用代码隐藏内容).

Add the namespace you used to your codebehind file or aspx file(if not using code behind).

using YourNamespace; //C#
imports YourNamespace //VB

或者如果不使用代码隐藏

or if not using codebehind

<%@ Import Namespace="YourNamespace" %>  

这篇关于在ASP.NET中导入类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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