我那个onclick这里错的  该怎么写

解决方案 »

  1.   


     public void downloadfile(string s_fileName)
        {
            HttpContext.Current.Response.ContentType = "application/ms-download";
            string s_path = HttpContext.Current.Server.MapPath("~/System/DataBackUp/") + s_fileName;
            System.IO.FileInfo file = new System.IO.FileInfo(s_path);
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.AddHeader("Content-Type", "application/octet-stream");
            HttpContext.Current.Response.Charset = "utf-8";
            HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(file.Name, System.Text.Encoding.UTF8));
            HttpContext.Current.Response.AddHeader("Content-Length", file.Length.ToString());
            HttpContext.Current.Response.WriteFile(file.FullName);
            HttpContext.Current.Response.Flush();
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.End();
        }
      

  2.   


    <asp:linkbutton .....
      

  3.   


    <a >超链接里面如何触发
      

  4.   

    <asp:LinkButton ID="LinkButton1" runat="server"></asp:LinkButton>你换成服务器控件就可以了在加一个后台事件
      

  5.   

    <a href="down.aspx?path=<%# Server.UrlEncode(Eval("url").ToString())">下载</a>down.aspx.cs里写下载代码
      

  6.   


    Server.UrlEncode  可以直接传值过去吗?
      

  7.   

    <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click" srcurl='绑定URL值'></asp:LinkButton>
    后台
                 protected void LinkButton1_Click(object sender, EventArgs e)
            {
                LinkButton lb = sender as LinkButton;
                string URL = lb.Attributes["srcurl"].ToString();
            }
      

  8.   


    Server.UrlEncode  可以直接传值过去吗?
    Server.UrlEncode是转义URL中的特殊字符,如中文,双引号等
      

  9.   


    Server.UrlEncode  可以直接传值过去吗?
    Server.UrlEncode是转义URL中的特殊字符,如中文,双引号等我是后台拼接字符串的下面两个是不是都错的?
    <a href=\"Down.aspx?path=<%=Server.URLEncode(Eval(\"" + path + "\").ToString())%>\"><a href=\"Down.aspx?path=<%=Server.URLEncode(Eval(\"" + path + "\").ToString())\">这样弄Down.aspx怎么接值啊  string path = Request.QueryString["path"].ToString();
    接过来为什么都是带<%=   是不是不应该这么接?