Help, page loads twice

N

Nathon Dalton

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.EventArgs) Handles MyBase.Load
Dim strRequest() As String
Dim x As Integer
Dim strResponse As String
If Not Page.IsPostBack Then
If Not Request("CallSheetID") Is Nothing AndAlso _
Convert.ToString(Request("CallSheetID")).IndexOf(",") > 0 Then
strRequest = Convert.ToString(Request("CallSheetID")).Split(",")
For x = 0 To strRequest.GetUpperBound(0)
strResponse += BuildSummary(Convert.ToInt32(strRequest(x)),
_
Convert.ToInt32(strRequest(strRequest.GetUpperBound(0))))
Next
Else
If IsNumeric(Request("CallSheetID")) Then
strResponse =
BuildSummary(Convert.ToInt32(Request("CallSheetID")), _
Convert.ToInt32(Request("CallSheetID")))
End If
End If
If strResponse.Length > 0 Then
Response.ContentType = "application/msword"
Response.Write(strResponse)
Response.Flush()
Try
Response.End()
Catch ex As System.Threading.ThreadAbortException
Return
End Try
End If
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top