在global.asax中加入了下面代码
<%@ Application ClassName="MyGlobals" %><script Language="C#" RunAt="server"> public static string water_type=“CCC”;</script> 我在页面文件相对应的CS文件中,如default.aspx.cs中。可以用ASP.MyGlobals.water_type取得water_type的值。
、
但我要类中怎么取得water_type的值呢?ASP.MyGlobals.water_type产生错误
<%@ Application ClassName="MyGlobals" %><script Language="C#" RunAt="server"> public static string water_type=“CCC”;</script> 我在页面文件相对应的CS文件中,如default.aspx.cs中。可以用ASP.MyGlobals.water_type取得water_type的值。
、
但我要类中怎么取得water_type的值呢?ASP.MyGlobals.water_type产生错误
解决方案 »
- 数据库依赖缓存
- Ajax中DropdownList问题。
- Ajax Control Toolkit中的PasswordStrength控件显示方式为BarIndicator时,如何设置其高度?
- 一个难题困扰了我很久
- 超级无敌 菜鸟问题
- 求助:怎样实现上传控件动态的增加,保存的时候能取到所有增加的控件选择的路径?
- 有没有办法把Server.MapPath得到的路径加入appSettings中?
- ascx 与 iframe 的访问速度
- 做了个网页,做的时候用服务器用localhost,改为http://192.168.148.86/的时候就调试不了,怎么帮,救我
- 如何把DropDownList其中的一项的Text的Color设为某一种颜色!
- (在线等!!!!) 框架中 局部刷新
- Microsoft.Office.Interop.Excel 布署后在web.config中出错,
可是在类CS文件中没有这个ASP的namespace
也就是说,在default.aspx.cs里可以用using ASP
但在BU.cs里面用using ASP就不存在了.
公用的静态变量不该放在global中./哪应该放在哪里好呢?怎么定义,我要的是定义一个静态变量..在整个项目里都能用.