asp.net - How to download an excel Sheet With a Dialog Box? -


i wanted show dialog box user save file prefers to. , had written code achieve this.

byte[] filebytes = system.io.file.readallbytes(excelpath); system.web.httpcontext context = system.web.httpcontext.current; context.response.clear(); context.response.clearheaders(); context.response.clearcontent(); context.response.appendheader("content-length", filebytes.length.tostring()); context.response.contenttype = "aapplication/xml"; context.response.appendheader("content-disposition", "attachment; filename=" + excelpath); context.response.binarywrite(filebytes); 

this downloading directly excel sheet directly without dialog box, i'm having no clue why not showing me dialog box. excel sheet of .xlsx format


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -