如何传递公有变量? 你可以用Session呀,不用传递了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 session("abc")='my string'別一個網頁調用就行了。 绝对不止一个Session 方案;还可以: 用Request.QueryString["common"] // http://url/page?common=helloworld 还可以: Application["common"] = "helloworld" ;// 在所有页面中公享;还可以: 将 string common = "helloworld" 写入 web.config 的 <configuration> <appSettings> <add key="common" value="helloworld" /> <appSettings> </configuration> Page 用 ConfigurationSettings.AppSettings["common"] ; to: solol() ViewState 只能在单个页起作用,它实际是保存在<input type="hidden" ...>当中; 如果说还有的话, Cache["common"] = "HELLO WOLRD"; 勉强算一个,但Cache 并不可靠!它随时被系统清除; 不是抽象类、局部类、为什么可以只写方法不写方法体?代码如下。 help help 关于上传时图片预览的一点问题 紧急求助:SQL Server2000服务器突然连接不上了 数据导到Excel时用代码插入分页符。100分求救! 如何将SqlParameter其写成公共类,在其他具体页面方便调用? 如何将DataGrid或DataList里的数据倒出为PDF文件并下载? 紧急求救!解答后立即散分 页面js代码没有执行 ASP.NET导出EXCEL的权限问题 怎么获得DataGrid第一行行数据? Table怎么做超级连接呢??
別一個網頁調用就行了。
还可以:
用Request.QueryString["common"] // http://url/page?common=helloworld
还可以:
Application["common"] = "helloworld" ;// 在所有页面中公享;
还可以:
将 string common = "helloworld" 写入 web.config 的
<configuration>
<appSettings>
<add key="common" value="helloworld" />
<appSettings>
</configuration>
Page 用 ConfigurationSettings.AppSettings["common"] ;
ViewState 只能在单个页起作用,它实际是保存在<input type="hidden" ...>当中; 如果说还有的话, Cache["common"] = "HELLO WOLRD";
勉强算一个,但Cache 并不可靠!它随时被系统清除;