And my total website is using AJAX (JS+ WebServices and no updatepanel), in this case I cannot use any server controls because that will post back my full page and I do not want that to happen. I had the requirement in my project to get the data from database and create an Excel file and insert the data and download the file to user machine. This technique is light weight on the page. You can use AJAX ( Scriptmanager + Updatepanel) to download the file from server, but you have to post back the page. (type, " scrHandlerStartUp", GetStartUpScript(), true) (type, " scrScripts", " Common/Loaders/LoadScripts.aspx") ExcelFile.xls) when you submit an iframe.Ĭopy Code protected void Page_Load( object sender, EventArgs e) Then create form tag with one input control to pass filename (e.g. It will create an iframe dynamically and which has width, height and border as 0. Create FileHandler.js file to do the main work.(DescriptionAttribute)fi.GetCustomAttributes Public static string MIMETypeDescription(Enum mimeType)įieldInfo fi = mimeType.GetType().GetField(mimeType.ToString())
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |