iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I am using custom "OnTheFlyPostBack" and on custom post back I output a pdf file using "OnTheFlyPostBack" using the following piece of code
"HttpResponse currentResponse = HttpContext.Current.Response;currentResponse.Clear();currentResponse.ClearHeaders(); currentResponse.ClearContent();
HttpResponse currentResponse = HttpContext.Current.Response;currentResponse.Clear();currentResponse.ClearHeaders(); currentResponse.ClearContent();
currentResponse.ClearHeaders(); currentResponse.ClearContent();
HttpResponse currentResponse = HttpContext.Current.Response;currentResponse.Clear(); currentResponse.ClearHeaders(); currentResponse.ClearContent();
currentResponse.AppendHeader("Content-Disposition", "attachment; filename=" + fileName);currentResponse.ContentType = mimeType;currentResponse.BinaryWrite(results);
currentResponse.ContentType = mimeType;
currentResponse.BinaryWrite(results);
The webgrid keeps on throwing an error and the code works fine when i do a full post back ? Is there a setting that I need to do in WebGrid to enable this behaviour ?
I suggest you to do the outputting pdf file in postback event rather than on the flypostback event.
I made a simple test by putting an asp.net postback button – that will trigger the function used to outputting pdf file – inside an asp.net update panel and find that the function no longer works.
Hope this helps.
Could you please kindly describe me more specific about your scenario, like in which server side event did you put your piece of code; what event that will trigger the code, is it clicking a button, refresh WebGrid, etc; the steps to reproduce the issue; etc?
If you have a running simple sample that replicates the issue, it would be much helpful if you could send the sample to us to be analyzed.
The following is the designer code in .aspx file
{
grid.AddInput("key",key); grid.SendCustomRequest(); }
grid.SendCustomRequest();
}
</asp:Content>
The following is the code behind
public partial class cs_WebGrid_SendingCustomRequest : System.Web.UI.Page
OutputFile();
currentResponse.Clear();
currentResponse.ClearHeaders();
currentResponse.ClearContent();
length = length - read;
offset = offset + read;
currentResponse.AppendHeader("Content-Disposition", "attachment; filename=" + "C:\\ReportBuilderHelpFile.doc"); currentResponse.ContentType = "application/octet-stream; name=ReportBuilderHelpFile.doc"; currentResponse.BinaryWrite(result);
currentResponse.ContentType = "application/octet-stream; name=ReportBuilderHelpFile.doc"; currentResponse.BinaryWrite(result);
currentResponse.BinaryWrite(result);
currentResponse.Flush();
As you can see, in the code if I click on the full post back button the code works fine, but not in the case of ONTheFlyPostBack
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname