asp.net页面静态化
方法一:
HtmlProxy.cs:
using System.Text;
using System.IO;
/// <summary>
/// HtmlProxy 的摘要说明
/// </summary>
public class HtmlProxy
{
public HtmlProxy()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public static bool ChangeFile(int id)
{
string filename = HttpContext.Current.Server.MapPath("Post_" + id + ".html");
//尝试读取已有文件
Stream st = GetFileStream(filename);
//如果文件存在并且读取成功
if (st != null) //文件存在
{
using (st)
{
StreamToStream(st, HttpContext.Current.Response.OutputStream);
return true;
//Response.End();
}
}
Else //文件不存在,根据ForumDetail.aspx页面的内容创建文件
{
StringWriter sw = new StringWriter();
HttpContext.Curre
相关文档:
ASP.NET
使用无Cookie的表单认证票据
默认情况下,forms authentication system将决定是将票据存储在cookies
collection里还是插入用户访问页面的URL里。所有主流的桌面浏览器,比如Internet
Explorer,Firefox,Opera,或Safari都支持cookies,但并非所有的移动设备都支持。
forms authentication system使用何种co ......
解决方法:
1.看看你的Terminal Services服务启动没有,如果没有启动就可以解决问题。
2确认 Machine Debug Manager 服务已启动
3、打开项目属性,在“Debug”(调试)一项里,把“Enable the Visual Studio hosting process”(启用Visual Studio 宿主进程)前的钩去掉。
4. ......
导出到excel的方法有多种,比较常见的是直接导出到EXCEL,还有就是先将页面的数据写到磁盘文件,之后直接再打开文件,另外还有就
是借助第三方的控件。
前段时间写的导出数据到excel在excel2003中正常而在excel2007中数据乱码,今天了解到原来是Response.ContentType = "application/ms-excel";导致的,改为R ......
Js代码
var url=Service.aspx?Value=' + escape(va);
obj=CreateAJAX();
if(obj)
& ......
Asp.net 后台调用js方法(转)
1. 用Response.Write方法
代码如下:
Response.Write("<script type='text/javascript'>alert("XXX");</script>");
此方法缺陷就是不能调用脚本文件中的自定义的函数,只能调用内部函数,具体调用自定义的函数只能在Response.Write写上函数定 义,比如
Response.Write("& ......