Click here to Skip to main content
14,927,434 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to use RenderControl() Method with Ajax controls Pin
Sathesh Sakthivel23-Jul-10 0:09
MemberSathesh Sakthivel23-Jul-10 0:09 
QuestionI want to open any audio file in my page Pin
jintalPatel22-Jul-10 22:57
MemberjintalPatel22-Jul-10 22:57 
AnswerRe: I want to open any audio file in my page Pin
Peace ON23-Jul-10 4:24
MemberPeace ON23-Jul-10 4:24 
QuestionPrint web page using ASP.NET Pin
NTheOne22-Jul-10 22:20
MemberNTheOne22-Jul-10 22:20 
AnswerRe: Print web page using ASP.NET Pin
Peace ON22-Jul-10 22:32
MemberPeace ON22-Jul-10 22:32 
GeneralRe: Print web page using ASP.NET Pin
NTheOne22-Jul-10 22:48
MemberNTheOne22-Jul-10 22:48 
GeneralRe: Print web page using ASP.NET Pin
Peace ON23-Jul-10 4:29
MemberPeace ON23-Jul-10 4:29 
QuestionViewstate not updated after TransmitFile Pin
KittyKit22-Jul-10 10:53
MemberKittyKit22-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
MemberYusuf22-Jul-10 13:52 
AnswerRe: Viewstate not updated after TransmitFile Pin
Prosanta Kundu online22-Jul-10 19:54
MemberProsanta Kundu online22-Jul-10 19:54 
AnswerRe: Viewstate not updated after TransmitFile Pin
T M Gray23-Jul-10 8:44
MemberT M Gray23-Jul-10 8:44 
AnswerRe: Viewstate not updated after TransmitFile Pin
KittyKit24-Jul-10 2:32
MemberKittyKit24-Jul-10 2:32 
QuestionHTML Print of Selected Tab using RenderControl Method Pin
NTheOne21-Jul-10 21:17
MemberNTheOne21-Jul-10 21:17 
AnswerRe: HTML Print of Selected Tab Pin
Peace ON21-Jul-10 21:30
MemberPeace ON21-Jul-10 21:30 
QuestionGlobal Distribution System in ASP.NET website Pin
Ahamed Azeem21-Jul-10 20:55
MemberAhamed Azeem21-Jul-10 20:55 
AnswerRe: Global Distribution System in ASP.NET website Pin
Peace ON21-Jul-10 21:15
MemberPeace ON21-Jul-10 21:15 
QuestionGridview Column colors Pin
codingrocks21-Jul-10 18:40
Membercodingrocks21-Jul-10 18:40 
AnswerRe: Gridview Column colors Pin
Prosanta Kundu online21-Jul-10 19:01
MemberProsanta Kundu online21-Jul-10 19:01 
AnswerRe: Gridview Column colors Pin
Peace ON21-Jul-10 19:44
MemberPeace ON21-Jul-10 19:44 
QuestionGetting sessions to ASMX webservice Pin
Matt Cavanagh21-Jul-10 8:40
MemberMatt Cavanagh21-Jul-10 8:40 
AnswerRe: Getting sessions to ASMX webservice Pin
Yusuf21-Jul-10 9:01
MemberYusuf21-Jul-10 9:01 
QuestionRe: Getting sessions to ASMX webservice [modified] Pin
Matt Cavanagh21-Jul-10 9:30
MemberMatt Cavanagh21-Jul-10 9:30 
Questionproblem writing in doc file Pin
Dhyanga21-Jul-10 5:39
MemberDhyanga21-Jul-10 5:39 
AnswerRe: problem writing in doc file Pin
Yusuf21-Jul-10 6:06
MemberYusuf21-Jul-10 6:06 
GeneralRe: problem writing in doc file [modified] Pin
Dhyanga21-Jul-10 6:14
MemberDhyanga21-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.