473,785 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Page on IIS is loaded twice

Hello,

i have an ASP Page that generates a PDF document.
After the generation i save the generated document as a file.
all works fine.

the only strange thing is, that my document is stored twice on the
filesystem.

why is the page loaded twice???
regards
Patrick
Jul 19 '05 #1
7 2711
How is the file stored twice? You can't have two files with the same name
in the same directory, so how do you know that your page is running twice?

Ray at home

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello,

i have an ASP Page that generates a PDF document.
After the generation i save the generated document as a file.
all works fine.

the only strange thing is, that my document is stored twice on the
filesystem.

why is the page loaded twice???
regards
Patrick

Jul 19 '05 #2
Because we archiving this document, i'll create a filename like
docname_user_ti me_seconds.pdf
The stream of the document will be created in a COM component.

That's why i know ... :-)

Patrick @work
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> schrieb im
Newsbeitrag news:uY******** ******@tk2msftn gp13.phx.gbl...
How is the file stored twice? You can't have two files with the same name
in the same directory, so how do you know that your page is running twice?

Ray at home

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello,

i have an ASP Page that generates a PDF document.
After the generation i save the generated document as a file.
all works fine.

the only strange thing is, that my document is stored twice on the
filesystem.

why is the page loaded twice???
regards
Patrick


Jul 19 '05 #3
Okay, we'd need to see some relevant code snippets then or get more info.
Are you calling a method twice? Are your users refreshing the page causing
the action to happen twice? Etc.

Ray at work

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:Ow******** ******@TK2MSFTN GP10.phx.gbl...
Because we archiving this document, i'll create a filename like
docname_user_ti me_seconds.pdf
The stream of the document will be created in a COM component.

That's why i know ... :-)

Patrick @work
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> schrieb im
Newsbeitrag news:uY******** ******@tk2msftn gp13.phx.gbl...
How is the file stored twice? You can't have two files with the same
name
in the same directory, so how do you know that your page is running
twice?

Ray at home

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> Hello,
>
> i have an ASP Page that generates a PDF document.
> After the generation i save the generated document as a file.
> all works fine.
>
> the only strange thing is, that my document is stored twice on the
> filesystem.
>
> why is the page loaded twice???
>
>
> regards
> Patrick
>
>



Jul 19 '05 #4
i solved the problem!
the KB article helped me:
http://support.microsoft.com/default...b;en-us;293792

it's how the ie gets the information to open the pdf-plugin...
here my code that solves the problem:

Response.Clear( );
Response.Expire s = 0;
Response.Buffer = false;

// First call ??
if(Request.Serv erVariables("HT TP_USER_AGENT") .Item == "contype")
{
// setting the contenttype to PDF
Response.Conten tType = "applicatio n/pdf";
}
else
{
// if reach here, the "second" call was made
// place the pdf-creating/storing here
// the Request.ServerV ariables("HTTP_ USER_AGENT").It em value is now
like:
// "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
1.0.3705; .NET CLR 1.1.4322)"

}

regards
Patrick
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> schrieb im
Newsbeitrag news:Oz******** *****@TK2MSFTNG P10.phx.gbl...
Okay, we'd need to see some relevant code snippets then or get more info.
Are you calling a method twice? Are your users refreshing the page causing the action to happen twice? Etc.

Ray at work

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:Ow******** ******@TK2MSFTN GP10.phx.gbl...
Because we archiving this document, i'll create a filename like
docname_user_ti me_seconds.pdf
The stream of the document will be created in a COM component.

That's why i know ... :-)

Patrick @work
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> schrieb im
Newsbeitrag news:uY******** ******@tk2msftn gp13.phx.gbl...
How is the file stored twice? You can't have two files with the same
name
in the same directory, so how do you know that your page is running
twice?

Ray at home

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> Hello,
>
> i have an ASP Page that generates a PDF document.
> After the generation i save the generated document as a file.
> all works fine.
>
> the only strange thing is, that my document is stored twice on the
> filesystem.
>
> why is the page loaded twice???
>
>
> regards
> Patrick
>
>



Jul 19 '05 #5

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
i solved the problem!
the KB article helped me:
http://support.microsoft.com/default...b;en-us;293792


Interesting article, thanks!

Ray at work
Jul 19 '05 #6
i've been glad too early.. it work not...
i think it was a cache problem that it works before... :(

any solutions??

my page does the following:
1. set the ContentType to "applicatio n/pdf"
2. get my pdf stream out of a component.
3. writing the stream with binaryWrite on the page.

the component saves "once" the document on filesystem.

i saw many topics that the iis get 2 requests...

"Patrick Ruhnow" <pr*****@dornbr acht.de> schrieb im Newsbeitrag
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
i solved the problem!
the KB article helped me:
http://support.microsoft.com/default...b;en-us;293792

it's how the ie gets the information to open the pdf-plugin...
here my code that solves the problem:

Response.Clear( );
Response.Expire s = 0;
Response.Buffer = false;

// First call ??
if(Request.Serv erVariables("HT TP_USER_AGENT") .Item == "contype")
{
// setting the contenttype to PDF
Response.Conten tType = "applicatio n/pdf";
}
else
{
// if reach here, the "second" call was made
// place the pdf-creating/storing here
// the Request.ServerV ariables("HTTP_ USER_AGENT").It em value is now
like:
// "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
1.0.3705; .NET CLR 1.1.4322)"

}

regards
Patrick
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> schrieb im
Newsbeitrag news:Oz******** *****@TK2MSFTNG P10.phx.gbl...
Okay, we'd need to see some relevant code snippets then or get more info. Are you calling a method twice? Are your users refreshing the page

causing
the action to happen twice? Etc.

Ray at work

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:Ow******** ******@TK2MSFTN GP10.phx.gbl...
Because we archiving this document, i'll create a filename like
docname_user_ti me_seconds.pdf
The stream of the document will be created in a COM component.

That's why i know ... :-)

Patrick @work
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> schrieb im Newsbeitrag news:uY******** ******@tk2msftn gp13.phx.gbl...
> How is the file stored twice? You can't have two files with the same
> name
> in the same directory, so how do you know that your page is running
> twice?
>
> Ray at home
>
> "Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
> news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> > Hello,
> >
> > i have an ASP Page that generates a PDF document.
> > After the generation i save the generated document as a file.
> > all works fine.
> >
> > the only strange thing is, that my document is stored twice on the
> > filesystem.
> >
> > why is the page loaded twice???
> >
> >
> > regards
> > Patrick
> >
> >
>
>



Jul 19 '05 #7
Hello...

after hard testing i have the following solution:

Response.Clear( );
Response.Expire s = 1;
Response.Buffer = false;

var d = new Date();

// Erster Aufruf??
if(Request.Serv erVariables("HT TP_USER_AGENT") .Item == "contype")
{
Response.Conten tType = "applicatio n/pdf";
}
else
{
Response.Conten tType = "applicatio n/pdf";
Response.AddHea der("content-disposition", "inline;filenam e=stream" +
Session.Session ID + d.getMillisecon ds() + ".pdf");
}

this snippet works..
i found out, that "my" problem was depending on the Expires Property.. it
must have a value > 0. otherwise
he makes two requests of the same USER_AGENT type.

It's not very satisfying, not to know why there is such a behaviour.
perhaps someone knows??


"Patrick Ruhnow" <pr*****@dornbr acht.de> schrieb im Newsbeitrag
news:uM******** ******@TK2MSFTN GP11.phx.gbl...
i've been glad too early.. it work not...
i think it was a cache problem that it works before... :(

any solutions??

my page does the following:
1. set the ContentType to "applicatio n/pdf"
2. get my pdf stream out of a component.
3. writing the stream with binaryWrite on the page.

the component saves "once" the document on filesystem.

i saw many topics that the iis get 2 requests...

"Patrick Ruhnow" <pr*****@dornbr acht.de> schrieb im Newsbeitrag
news:uA******** ******@TK2MSFTN GP09.phx.gbl...
i solved the problem!
the KB article helped me:
http://support.microsoft.com/default...b;en-us;293792

it's how the ie gets the information to open the pdf-plugin...
here my code that solves the problem:

Response.Clear( );
Response.Expire s = 0;
Response.Buffer = false;

// First call ??
if(Request.Serv erVariables("HT TP_USER_AGENT") .Item == "contype")
{
// setting the contenttype to PDF
Response.Conten tType = "applicatio n/pdf";
}
else
{
// if reach here, the "second" call was made
// place the pdf-creating/storing here
// the Request.ServerV ariables("HTTP_ USER_AGENT").It em value is now
like:
// "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
1.0.3705; .NET CLR 1.1.4322)"

}

regards
Patrick
"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> schrieb im
Newsbeitrag news:Oz******** *****@TK2MSFTNG P10.phx.gbl...
Okay, we'd need to see some relevant code snippets then or get more info. Are you calling a method twice? Are your users refreshing the page causing
the action to happen twice? Etc.

Ray at work

"Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
news:Ow******** ******@TK2MSFTN GP10.phx.gbl...
> Because we archiving this document, i'll create a filename like
> docname_user_ti me_seconds.pdf
> The stream of the document will be created in a COM component.
>
> That's why i know ... :-)
>
> Patrick @work
>
>
> "Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> schrieb im
> Newsbeitrag news:uY******** ******@tk2msftn gp13.phx.gbl...
>> How is the file stored twice? You can't have two files with the

same >> name
>> in the same directory, so how do you know that your page is running
>> twice?
>>
>> Ray at home
>>
>> "Patrick Ruhnow" <pr*****@dornbr acht.de> wrote in message
>> news:%2******** ********@tk2msf tngp13.phx.gbl. ..
>> > Hello,
>> >
>> > i have an ASP Page that generates a PDF document.
>> > After the generation i save the generated document as a file.
>> > all works fine.
>> >
>> > the only strange thing is, that my document is stored twice on the >> > filesystem.
>> >
>> > why is the page loaded twice???
>> >
>> >
>> > regards
>> > Patrick
>> >
>> >
>>
>>
>
>



Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1980
by: Tim | last post by:
I have dropdown list in Login page. The data is adding twice because the Page_Load event is executing twice. But I am checking !Page.IsPostBack property. First time the value for '!Page.IsPostBack' is 'true'. When it goes for second time it is not setting to 'false'. Please remember the '!' before the property. Which is means that still it is not recognizing that the page is loaded. Basically the Login page is redirecting from the...
2
3821
by: anonieko | last post by:
Scenario: You have a page that is TOO slow to refresh. But it allows partial flushing of html contents. I.e. Submit button already appears but you don't want your users to click on it prematurely because other parts are still coming. Here I put a javascript the will enable only submit button only after 5 seconds after the page is load fully.
5
2921
by: Tim | last post by:
I have block of code adding values to dropdown list under if (!Page.IsPostBack) { adding items } else { refreshing data }
1
6347
by: Tim | last post by:
I have dropdown list in Login page. The data is adding twice because the Page_Load event is executing twice. But I am checking !Page.IsPostBack property. First time the value for '!Page.IsPostBack' is 'true'. When it goes for second time it is not setting to 'false'. Please remember the '!' before the property. Which is means that still it is not recognizing that the page is loaded. Basically the Login page is redirecting from the...
0
5752
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is selected, it causes the ServerClick event to be called twice. Here's the code: You'll see that there are two grids on the page, and that the function SetupDataGrid populates data to the two grid. There are also
5
7538
by: Asa Monsey | last post by:
I am having a problem that the page load event fires twice in reponse to an autopostback. The first time, the IsPostBack property is true, and the second time it it false. This is causing many uneeded database calls, since many of them do not need to be fired on a PostBack. I have already set the AutoEventWireup=false in the ASPX @Page directive. I am setting the visible property of a datagrid in some of my methods, but I commented...
2
1558
by: hemant.singh | last post by:
I am stuck with strange JS issue My product gives user to show some images(which track mouseover) on page by embedding script like <script src=http://domain.com/GetDynamicJS?domagic=1> </script> Now user is embedding more than of the above and when user mouse over's the image output of first1 than function getting called is script loaded in last ... thus error, as that script don't have the relevant
2
1469
by: =?Utf-8?B?VG9tw6FzIE1hcnTDrW5leg==?= | last post by:
Hi, I recently converted an ASP.NET project for framework 2.0. I never had any problem using VS 2003 but today, debugging a page, I get surprised when I saw that once debugged the last line, it was automatically debugged another time since the first line and even the "if (!IsPostBack)..." code was runned (when it shouldn't, previously was not runned as it should be)... so many variables are reinitializated and it doesn't runs as it...
22
2355
by: Christopher Nelson | last post by:
I have a little menu system which essentially takes HTML like: <div id='foo'></div> and retrieves foo.shtml from the server and inserts it inside the <div>. But sometimes I'd like foo.shtml to look like: <script language='JavaScript'> ...do something AJAX-y </script>
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.