请问一下:Global.asax这么定义全局变量对吗?
protected void Application_Start(object sender, EventArgs e)
{
string str_pop_title1; // 포프창의 제목 축구
string str_pop_link1; // 포프창의 프레임주소 축구.
}我在别的页里无法用
string str_pop_title1; // 포프창의 제목 축구
string str_pop_link1; // 포프창의 프레임주소 축구.这二个变量.
protected void Application_Start(object sender, EventArgs e)
{
string str_pop_title1; // 포프창의 제목 축구
string str_pop_link1; // 포프창의 프레임주소 축구.
}我在别的页里无法用
string str_pop_title1; // 포프창의 제목 축구
string str_pop_link1; // 포프창의 프레임주소 축구.这二个变量.
解决方案 »
- asp.net 友好提示问题
- vs2008未安装C#的vs语言支持如何解决
- 我在使用一个日期控件时,出现以下错误:无法创建控件,因为Visual studio无法在控件程序集中找到该控件的类型
- 请教GridView利用存储过程分页的问题?谢谢!
- 收集.net web方面的面视题
- vb.net开发的网站与C#开发的网站合并的问题(Session的传递) 在线等
- 在服务器端有没有类似window.document.body.innerHTML的功能
- sQL 插入问题
- 请教高手,在.net下用CrystalReportViewer调用一个带参数的水晶报表时,利用控件自带的导出按钮出现下面的错误这是为何?
- 问一个ASP.NET的简单问题?
- 关于asp.网程序员要不要学javascript的问题
- vb.net怎样保存网页
//在定义类的地方
public class Class_Public
{
public static string AllUsed = "ffff";
}
//在全局类里
protected void Application_Start(object sender, EventArgs e)
{
Class_Public cp = new Class_Public();
}//在你需要使用的地方protected void Page_Load(object sender, EventArgs e)
{
string ss = Common.Class_Public.AllUsed;
}
protected void Application_Start(object sender, EventArgs e)
{
Class_Public cp = new Class_Public();
}
在这里用cp引用了.
可是在下面.//在你需要使用的地方protected void Page_Load(object sender, EventArgs e)
{
string ss = Common.Class_Public.AllUsed;
}并没有用到cp
请问这是怎么回事?
public static class Class_Public
{
public string AllUsed = "ffff";
}
//在你需要使用的地方protected void Page_Load(object sender, EventArgs e)
{
string ss = Common.Class_Public.AllUsed;
}