输出PDF文档到ASP.NET页面
protected
void Page_Load(object sender, EventArgs e)
{
try
{
//query the pdf path
string pdfna =
this.Request.QueryString["pdf"];
if (pdfna == null)
throw new Exception("This
page can not be accessed directly");
string pdf = "Reports\\" +
pdfna;
pdf = Server.MapPath(pdf);
//read all bytes
if (File.Exists(pdf) == false)
throw new Exception("This
report is not created");
FileStream fs = File.Open(pdf,
FileMode.Open);
byte[] buffer = new
byte[fs.Length];
fs.Read(buffer, 0,
buffer.Length);
fs.Close();
//write to response
Response.ContentType =
"application/pdf";
Response.AddHeader(
相关文档:
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Att ......
asp.net发布网站时三个选项的问题
发布网站的时候有三个选项:
第一个选项指定发布后是不是可以修改aspx文件,如果勾选,则发布后的网站行为基本与ASP.NET 1.1一致,只要没有增删修改控件,可以直接在服务器上修改aspx文件不用重新发布网站。
第二个选项指定是不是将每个aspx文件都编 ......
GET /Img.ashx?img=svn_work.gif HTTP/1.1
Accept: */*
Referer: http://www.svnhost.cn/
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5 ......
前言
写这篇文章的目的,是想总结一些东西,以帮助朋友们更好的使用这个框架。但是,我又不像把官方列举的哪些优势、功能翻译过来列举在这里。所以,我想干脆我就纯从个人观点上对这个框架评论一下吧。说的不好的,不对的还请批评指正。
ASP.NET MVC——螺旋进步的产物
对于微软为什么要推出ASP.NET MVC,我们 ......