Help, page loads twice

Discussion in 'ASP .Net' started by Nathon Dalton, Jun 26, 2003.

  1. 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
     
    Nathon Dalton, Jun 26, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sue Rawlings

    ASP .NET page loads twice

    Sue Rawlings, Feb 10, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,661
    Rimu Atkinson
    Feb 10, 2004
  2. Scott Allen
    Replies:
    0
    Views:
    1,830
    Scott Allen
    Aug 4, 2004
  3. yohaas
    Replies:
    0
    Views:
    428
    yohaas
    Oct 12, 2006
  4. Kiuhnm

    twice(twice(x))

    Kiuhnm, Apr 1, 2006, in forum: C++
    Replies:
    2
    Views:
    395
    Kiuhnm
    Apr 1, 2006
  5. RAMESH BABU VEERAMANI (RAMBAB)

    Page with User control loads twice.

    RAMESH BABU VEERAMANI (RAMBAB), Jul 24, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    171
Loading...

Share This Page