易截截图软件、单文件、免安装、纯绿色、仅160KB

输出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(


相关文档:

asp.net后台与前台的互相调用

一.后台调用前台
1.Page.ClientScript.RegisterStartupScript(type,"",script);
例:
string script = string.Format("<script>alert('Wrong');</script>");
Page.ClientScript.RegisterStartupScript(GetType(), "Load", script);
2.对象.Attributes.Add("事件","script")
例:
e.Row.Attributes.Add("on ......

asp.net 小菜鸟 必学

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发布网站时三个选项的问题


asp.net发布网站时三个选项的问题
 
发布网站的时候有三个选项: 
第一个选项指定发布后是不是可以修改aspx文件,如果勾选,则发布后的网站行为基本与ASP.NET   1.1一致,只要没有增删修改控件,可以直接在服务器上修改aspx文件不用重新发布网站。 
第二个选项指定是不是将每个aspx文件都编 ......

asp.net数据库操作类(存储过程处理)

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.ComponentModel;
namespace SQLHelper
{
 /// <summary>
 /// Class1 的摘要说明。
 /// </summary>
 public class SQLHelper
 {
  // 连接数据源
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号