FineUI/FineUI_v6/FineUI.Examples/message/alert_download_hideiframe.aspx.cs

42 lines
1.2 KiB
C#
Raw Permalink Normal View History

2017-09-05 11:30:31 +08:00
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUI.Examples.message
{
public partial class alert_download_hideiframe : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
else
{
string requestArgument = GetRequestEventArgument();
if (requestArgument == "Confirm_OK")
{
// 非AJAX回发
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=alert_download.txt");
Response.ContentType = "text/plain";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write("这是下载文件的内容!");
Response.End();
}
if (requestArgument == "Confirm_Cancel")
{
// AJAX回发
ShowNotify("点击了取消按钮!");
}
}
}
}
}