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

Home Posts Topics Members FAQ

Help, page loads twice

I need help! A page I'm working on builds an HTML string based on a bunch of
data in different tables and databases. Then it does a response.write with a
contenttype of application/msword. The result being an HTML page that's
editable in word, inside of Internet Explorer. The problem I'm getting is
that the page is loading twice. It's blowing out session information, so I
can't keep track of how many times it has ran. Here's the code.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim strRequest() As String
Dim x As Integer
Dim strResponse As String
If Not Page.IsPostBack Then
If Not Request("CallSh eetID") Is Nothing AndAlso _
Convert.ToStrin g(Request("Call SheetID")).Inde xOf(",") > 0 Then
strRequest = Convert.ToStrin g(Request("Call SheetID")).Spli t(",")
For x = 0 To strRequest.GetU pperBound(0)
strResponse += BuildSummary(Co nvert.ToInt32(s trRequest(x)),
_
Convert.ToInt32 (strRequest(str Request.GetUppe rBound(0))))
Next
Else
If IsNumeric(Reque st("CallSheetID ")) Then
strResponse =
BuildSummary(Co nvert.ToInt32(R equest("CallShe etID")), _
Convert.ToInt32 (Request("CallS heetID")))
End If
End If
If strResponse.Len gth > 0 Then
Response.Conten tType = "applicatio n/msword"
Response.Write( strResponse)
Response.Flush( )
Try
Response.End()
Catch ex As System.Threadin g.ThreadAbortEx ception
Return
End Try
End If
End If
End Sub
Nov 17 '05 #1
0 1797

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

Similar topics

10
3181
by: Manny | last post by:
I have a web form "Page1.asp" and it reads data from a database, does some calculations, and displays the records in pages. Works fine. I have a button that displays on the page, defined as <input type="button" onClick="OutputData()"> The OutputData() function is a javascript function that simply does this: window.location = "Page1.asp?Flag=1";
4
1404
by: ani | last post by:
I have a datalist control in my aspx page(this is paginated and everytime submits to itself). I am calling a function within my datalist that returns a html control (radio button ) in the form of the string. I also have asp server controls(labels) in the datalist. When the form is processed, I am retrieving the values of the radio buttons through Request.form. To retrieve the values of the asp server controls , I am using FindControl...
3
4532
by: Sue Rawlings | last post by:
I am using VS .net and when I have a page with smartnav = true, and this page (that has smartnav on) does a response.redirect to another page, the page load event occurs twice for the page specified by the response.redirect. When I set smartnav = false, this does not occur (page load occurs only once). Does .net 2003 fix this?
1
1899
by: spammy | last post by:
Hi all, Im having difficulty serving synamically generated PDFs to clients via asp.net. Im using crystal reports to generate them. In my page load I have the following: private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here try
0
1063
by: Guy W via DotNetMonster.com | last post by:
I read and tried to use the repeater paging method I found on 4 Guys from Rolla (I've tried others also) but it doesn't seem to work. Please see the code I have below and tell me what I may be doing wrong. I'm using Visual Studio with SQL 2000. This is question/answer page that loads questions & answers dynamically. I would like to present 1 question at a time instead of all questions on one page as quizzes may have up to 50 questions. ...
4
2138
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a Delete button on the end of each row. I am unable to gain access to the event when the button is clicked. I don't fully understand how the click gets connected to the C# code,
1
521
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event, which I am). I now want to read the text/values of those controls. I have found out that I can read the values if I wait until Page_Load, but then I have the same questions showing up again (along with the new questions) and I do not want them to....
6
4532
by: dean.h.brown | last post by:
How do you get the Calendar date when the page first loads? I have this code (which works once the user selects a date) - I get "12:00:00 AM" for the label.text when the page first loads: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Label1.Text = Calendar1.SelectedDate End Sub
2
4183
by: =?Utf-8?B?SnJ4dHVzZXIx?= | last post by:
I just started using Windows Live OneCare, I had been using Norton, but was unable to fix the problems I was having. I have yet been unsuccessful with OneCare as well. I keep getting the same warning from OneCare, one is for Adware, the other is for a trojan, I clean both, but almost immediatly, I get the same warning? My Windows Defender is also shut down, not by me as I have no idea how to do this(or to turn it back on), but am still...
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...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7506
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
5390
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
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
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
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
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.