create an asp page "Download.aspx"
In Design side just have
Code on CS side
**********
string strFile= "";
if (Request.QueryString.HasKeys())
{
if ((Request.QueryString["vid"] != null) || Request.QueryString["vid"].ToString().Equals("")) // where vid is your querystiing
{
strFile= Request.QueryString["vid"].ToString();
}
}
try
{
this.EnableViewState = false;
Response.ContentType = "text/xml";
string Filename = System.Web.HttpContext.Current.Server.MapPath("test.xml");// your file name
//Filename = Filename + certId + ".vcf";
Response.WriteFile(Filename);
Response.Buffer = true;
Response.AddHeader("Content-Disposition", "attachment; filename=" + Filename );
}
catch (Exception ex) { Response.Write(ex.ToString()); }
Response.End();
No comments:
Post a Comment