Click here to Skip to main content
15,908,112 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Store Dataset into session variable Pin
C0ding_j3ff28-Apr-21 12:02
C0ding_j3ff28-Apr-21 12:02 
QuestionWhat is REDUX? Pin
DineshPadupalli2-Apr-21 1:05
DineshPadupalli2-Apr-21 1:05 
AnswerRe: What is REDUX? Pin
Richard MacCutchan2-Apr-21 2:19
mveRichard MacCutchan2-Apr-21 2:19 
QuestionResponse.Headers.Remove(“Server”) does not work in global.Asax. when run project show “This operation requires IIS integrated pipeline mode” issue Pin
Member 1358101725-Mar-21 1:30
Member 1358101725-Mar-21 1:30 
QuestionRe: Response.Headers.Remove(“Server”) does not work in global.Asax. when run project show “This operation requires IIS integrated pipeline mode” issue Pin
SeanChupas25-Mar-21 3:27
SeanChupas25-Mar-21 3:27 
AnswerRe: Response.Headers.Remove(“Server”) does not work in global.Asax. when run project show “This operation requires IIS integrated pipeline mode” issue Pin
Member 1358101725-Mar-21 20:32
Member 1358101725-Mar-21 20:32 
QuestionRe: Response.Headers.Remove(“Server”) does not work in global.Asax. when run project show “This operation requires IIS integrated pipeline mode” issue Pin
SeanChupas29-Mar-21 0:55
SeanChupas29-Mar-21 0:55 
QuestionThe remote server returned an error: (403) Forbidden. Pin
Vimalsoft(Pty) Ltd24-Mar-21 0:30
professionalVimalsoft(Pty) Ltd24-Mar-21 0:30 
Good Day Everyone

I have a response which i convert to byte array and download the pdf at the end. This code does download a PDF in localhost but gives an error

{"Thread was being aborted."}

and the file still get downloaded correctly. The code is defined as below
<pre>string URL = "http://myserver/ReportServer/Pages/ReportViewer.aspx?%2fbills%2fISU_PDF_GEN_APT&rs:Command=Render";
          string Command = "Render";
          string Format = "PDF";
          //We can get values of these parameters from Request object.
          string Contract_account_number = AccountNumber;
          URL = URL + "&rs:Command=" + Command + "&rs:Format=" + Format + "&Contract_Account_Number=" + Contract_account_number;
           System.Net.HttpWebRequest Req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(URL);
          Req.Credentials = System.Net.CredentialCache.DefaultCredentials;
          Req.UseDefaultCredentials = true;
          Req.Method = "GET";
          System.Net.WebResponse objResponse = Req.GetResponse();
          System.IO.Stream stream = objResponse.GetResponseStream();
          var document = GenericMethods.StreamToByteArray(stream);
          Response.AddHeader("Content-type", "application/octet-stream");
          Response.AddHeader("Content-Disposition", "attachment; filename=" + AccountNumber + ".pdf");
          Response.BinaryWrite(document);
          Response.Flush();
          Response.End();</pre>

when i host this in IIS i get an Error

The remote server returned an error: (403) Forbidden.

Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com

AnswerRe: The remote server returned an error: (403) Forbidden. Pin
Richard Deeming24-Mar-21 2:22
mveRichard Deeming24-Mar-21 2:22 
QuestionPdf to image converter Pin
Member 1501160216-Mar-21 20:42
Member 1501160216-Mar-21 20:42 
AnswerRe: Pdf to image converter Pin
Deepak Vasudevan22-Mar-21 3:13
Deepak Vasudevan22-Mar-21 3:13 
AnswerRe: Pdf to image converter Pin
Bohdan Stupak7-Apr-21 22:09
professionalBohdan Stupak7-Apr-21 22:09 
AnswerPlugins for api blog2.0 Pin
Member 1509734011-Mar-21 2:41
Member 1509734011-Mar-21 2:41 
GeneralRe: Plugins for api blog2.0 Pin
Deepak Vasudevan22-Mar-21 6:27
Deepak Vasudevan22-Mar-21 6:27 
QuestionHow do I install Winform NET 5 on Mac Pin
Member 150947959-Mar-21 16:24
Member 150947959-Mar-21 16:24 
AnswerFEED aggregator plugin Pin
Member 150933708-Mar-21 5:55
Member 150933708-Mar-21 5:55 
QuestionArgument out of range exception Pin
samflex17-Feb-21 18:38
samflex17-Feb-21 18:38 
AnswerRe: Argument out of range exception Pin
Richard MacCutchan17-Feb-21 21:36
mveRichard MacCutchan17-Feb-21 21:36 
QuestionHow to Printing Network IP through MVC C# Pin
Member 150622761-Feb-21 20:32
Member 150622761-Feb-21 20:32 
AnswerRe: How to Printing Network IP through MVC C# Pin
Richard Deeming1-Feb-21 21:44
mveRichard Deeming1-Feb-21 21:44 
AnswerRe: How to Printing Network IP through MVC C# Pin
jkirkerx16-Feb-21 11:23
professionaljkirkerx16-Feb-21 11:23 
QuestionAngular NetCore 5 project and webpack 4.6 Pin
jkirkerx31-Jan-21 12:28
professionaljkirkerx31-Jan-21 12:28 
AnswerRe: Angular NetCore 5 project and webpack 4.6 [Pretty Close to Solving] Pin
jkirkerx1-Feb-21 6:21
professionaljkirkerx1-Feb-21 6:21 
QuestionGridView Not Refreshing after search function Executing. Pin
Darshan Kumar B25-Jan-21 1:30
Darshan Kumar B25-Jan-21 1:30 
AnswerRe: GridView Not Refreshing after search function Executing. Pin
20212a25-Jan-21 3:27
20212a25-Jan-21 3:27 

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.