我在整个.aspx页面中遇到问题(下载服务器到客户端项目)............. [英] I have a problem in entire .aspx page ( Download Server To Client Project ).............

查看:87
本文介绍了我在整个.aspx页面中遇到问题(下载服务器到客户端项目).............的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

整个PROG IAM获得错误



请回复



Hi, ENTIRE PROG IAM GETTING ERRORS

pls reply

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Globalization;
using System.Security;
using System.Xml;
using System.Web.UI.HtmlControls;

namespace downloading_server_to_client
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // user defined function to download a file 
            Static Public Void Download File(string FIle Path)
    {
        try
    {
        // it will open the download window
        HttpContext.Current.Responce.Context="Application/oclet-stream"
        // it will display info on that fil,
        HttpContext.Current.Responce.Add Header,
            ("Context-Disposition","Attachment;File Name="+System.IO.Path.Get File Name(File Path));
        HttpContext.Current.Responce.Clear();
        HttpContext.Current.Responce.Write File(File Path);
        HttpContext.Current.Responce End();
    }
    Catch(Exception Ex)
{
    Throw Ex;
}
        }
Page Load ()
{
String.P= Server Map Path("~/Files/Fav.S.Doc");
// To Get File Info
File info & Info = New File Info (P);
Long.S= f info.Length;
Double.1=S/1024.00;
Lable1.Text=String.Format("{0:f}",1),"Kb";
}
Link Button1_Click()
{
string P= Server.Map Path ("~/Files/Fav.S.Doc");
Download File(P); 
    }
}
}
}

推荐答案

Quote:

编译器错误消息:CS1061:'ASP.default_aspx'不包含'LinkBut​​ton2_Click'的定义,也没有扩展方法'LinkBut​​ton2_Click'接受类型'的第一个参数可以找到ASP.default_aspx'(您是否缺少using指令或程序集引用?)

Compiler Error Message: CS1061: 'ASP.default_aspx' does not contain a definition for 'LinkButton2_Click' and no extension method 'LinkButton2_Click' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)

错误消息非常清楚。你还没有在后面的代码上定义 LinkBut​​ton 点击 EventHandler



请定义代码背后的代码。

The error message is quite clear. You have not defined the LinkButton Click EventHandler on code behind.

Please define that on code behind.


这篇关于我在整个.aspx页面中遇到问题(下载服务器到客户端项目).............的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆