Gaurav Taneja

Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

  Home  |   Contact  |   Syndication    |   Login
  90 Posts | 0 Stories | 78 Comments | 7 Trackbacks

News




Google RankGoogle PRâ„¢ - Post your Page Rank with MyGooglePageRank.com



The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.

Disclaimer:- All postings in this blog is provided "AS IS" with no warranties, and confers no rights.

Archives

Post Categories

Image Galleries

Atlas

Error

OutLook

SharePointService

Usefull Site Links

How to save a file on client side?

create an asp page "Download.aspx"

In Design side just have

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Download.aspx.cs" Inherits="Download" ContentType="Text/xml" %>

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();

 

**********

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Wednesday, January 24, 2007 11:04 AM

Feedback

# re: How to save a file on client side 3/2/2009 10:26 PM vivek gupta
sir,
My problem is that i want the client has filled data in resp. controls(textbox) that data should be saved on in text file in client system (i.e. data should be saved on client side in asp.net using c#.)


Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: