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
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