Click here to Skip to main content
15,889,654 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to use RenderControl() Method with Ajax controls Pin
Sathesh Sakthivel23-Jul-10 0:09
Sathesh Sakthivel23-Jul-10 0:09 
QuestionI want to open any audio file in my page Pin
jintalPatel22-Jul-10 22:57
jintalPatel22-Jul-10 22:57 
AnswerRe: I want to open any audio file in my page Pin
Peace ON23-Jul-10 4:24
Peace ON23-Jul-10 4:24 
QuestionPrint web page using ASP.NET Pin
NTheOne22-Jul-10 22:20
NTheOne22-Jul-10 22:20 
AnswerRe: Print web page using ASP.NET Pin
Peace ON22-Jul-10 22:32
Peace ON22-Jul-10 22:32 
GeneralRe: Print web page using ASP.NET Pin
NTheOne22-Jul-10 22:48
NTheOne22-Jul-10 22:48 
GeneralRe: Print web page using ASP.NET Pin
Peace ON23-Jul-10 4:29
Peace ON23-Jul-10 4:29 
QuestionViewstate not updated after TransmitFile Pin
KittyKit22-Jul-10 10:53
KittyKit22-Jul-10 10:53 
Hello there

I have been spending almost half-a-day to get this problem solved, but could not even find a single article that would help me. I wonder whether nobody else has faced this problem.

Okay, my webpage involves creating excel files. My download button has code like this

HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=clientcopy.xlsx");
HttpContext.Current.Response.TransmitFile(Server.MapPath("App_data/" + Viewstate["FileName"]));
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Close();
HttpContext.Current.Response.End();

Alright. this works fine. The problem is, After downloading I want to make Viewstate["FileName"] to be null. But whatever I do, during the next post back after the filetransmit, the Viewstate["FileName"] still retains the old value and refuses to get updated to null. I tried writing the Viewstate["FileName"] = null; at every possible place in the above code - at the begining, in the middle and at the end after response.end(). BUT no way Cry | :((
Can someone help on how to modify the viewstate after a file transmit???

Note:
=====
My webpage has an update panel. Button "GO" displays a report in the update panel based on some selections outside the updatepanel. Button "ADD" keeps on adding the displayed reports to an excelfile until Button "download" is clicked and excelfile is downloaded. "GO" and "ADD" triggers partial postback and "download" triggers fullpostback.

thanks
Kit
AnswerRe: Viewstate not updated after TransmitFile Pin
Yusuf22-Jul-10 13:52
Yusuf22-Jul-10 13:52 
AnswerRe: Viewstate not updated after TransmitFile Pin
Prosanta Kundu online22-Jul-10 19:54
Prosanta Kundu online22-Jul-10 19:54 
AnswerRe: Viewstate not updated after TransmitFile Pin
T M Gray23-Jul-10 8:44
T M Gray23-Jul-10 8:44 
AnswerRe: Viewstate not updated after TransmitFile Pin
KittyKit24-Jul-10 2:32
KittyKit24-Jul-10 2:32 
QuestionHTML Print of Selected Tab using RenderControl Method Pin
NTheOne21-Jul-10 21:17
NTheOne21-Jul-10 21:17 
AnswerRe: HTML Print of Selected Tab Pin
Peace ON21-Jul-10 21:30
Peace ON21-Jul-10 21:30 
QuestionGlobal Distribution System in ASP.NET website Pin
Ahamed Azeem21-Jul-10 20:55
Ahamed Azeem21-Jul-10 20:55 
AnswerRe: Global Distribution System in ASP.NET website Pin
Peace ON21-Jul-10 21:15
Peace ON21-Jul-10 21:15 
QuestionGridview Column colors Pin
codingrocks21-Jul-10 18:40
codingrocks21-Jul-10 18:40 
AnswerRe: Gridview Column colors Pin
Prosanta Kundu online21-Jul-10 19:01
Prosanta Kundu online21-Jul-10 19:01 
AnswerRe: Gridview Column colors Pin
Peace ON21-Jul-10 19:44
Peace ON21-Jul-10 19:44 
QuestionGetting sessions to ASMX webservice Pin
Matt Cavanagh21-Jul-10 8:40
Matt Cavanagh21-Jul-10 8:40 
AnswerRe: Getting sessions to ASMX webservice Pin
Yusuf21-Jul-10 9:01
Yusuf21-Jul-10 9:01 
QuestionRe: Getting sessions to ASMX webservice [modified] Pin
Matt Cavanagh21-Jul-10 9:30
Matt Cavanagh21-Jul-10 9:30 
Questionproblem writing in doc file Pin
Dhyanga21-Jul-10 5:39
Dhyanga21-Jul-10 5:39 
AnswerRe: problem writing in doc file Pin
Yusuf21-Jul-10 6:06
Yusuf21-Jul-10 6:06 
GeneralRe: problem writing in doc file [modified] Pin
Dhyanga21-Jul-10 6:14
Dhyanga21-Jul-10 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.