IE progress bar never stops incrementing...

Last post 11-01-2006 9:48 AM by corn29. 2 replies.

Sort Posts:

  • IE progress bar never stops incrementing...

    10-31-2006, 1:45 PM
    • Member
      139 point Member
    • corn29
    • Member since 06-07-2006, 10:10 AM
    • Posts 48
    Hello,

    I'm able to reproduce my problem but I haven't been able to figure out
    why it is happening.  MS does have an article about such behavior in
    http://support.microsoft.com/default.aspx?scid=kb;en-us;Q320731 but the
    workaround prescribed in the KB isn't particularly helpful.

    The project I'm working on serves up a custom jpg image on the client
    side at runtime (think MapQuest or Google Maps).  We use a COTS product
    here to handle the image creation.  You'll see the references to the
    COTS in the code below through use of the "aims" namespace.  As you
    will also see, there's no rocket science to the code I've posted.

    I'm using some code which was given to me.  I've pasted it below in as
    a lightweight version.  To support some custom functionality (zooming
    in and out and identifying objects on the map via a mouseclick among
    other things), this code creates the jpg on the server side, places the
    path to the jpg in a hidden field, and then on the client side the
    hidden field value is set to an html img src.

    The problem is the browser's progress bar always keeps increasing and
    never stops. Everything else appears to be working normally and the
    user can mess around with the page. But the cursor always stays as the
    hourglass and pointer combo and the browser's progress bar never
    stops incrementing (albeit very slowly).

    Eventually, as the page runs for an extended period of time, the
    browser throws a stack overflow and the whole thing starts hindering
    the performance of the host machine.  I did some debugging and noticed
    that the codebehind Page_Load event handler keeps getting called
    repeatedly.  Thinking this was because of the time it takes for the
    image to be displayed versus rending the rest of the page, the whole
    thing thinks the Page_Load event never completes... kind like an
    infinite loop.  To get around that I tried wrapping the code in the
    Page_Load event handler in an If Not Page.IsPostBack... but that didn't
    help either.

    I'm now suspecting the problem could be due to the img onload event
    handler clashing with the code behind Page_Load event handler.  But
    nothing too terribly complicated is going on there... I'm just going
    out and assigning the src property to the hidden field's value
    property.

    Suggestions are greatly appreciated.

    Thanks!

    1.  HTML:

    <body>
      <form id="form1" runat="server">
        <div>
          <img id="mapImage" src="Images/null.gif" onload="getImage();"/>
          <br />
          <asp:HiddenField ID="mapImageSrc_hidden" runat="server" />
        </div>
      </form>
    </body>

    2.  Server-side Code:

       Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load

            Dim resultRefresh, urlImage
            Dim mConnector As New aims.ArcIMSConnector

            mMap = Server.CreateObject("aims.Map")
            mConnector = Server.CreateObject("aims.ArcIMSConnector")
            mConnector.ServerName = "csfdcrw"
            mConnector.ServerPort = 5300

            resultInit = mMap.InitMap(mConnector, "Internal")

            resultRefresh = mMap.Refresh()

            urlImage = mMap.GetImageAsUrl()

            Me.mapImageSrc_hidden.Value = urlImage

        End Sub

    3.  Client-side Code:

    function getImage()
    {
      var objHiddenImage = document.getElementById("mapImageSrc_hidden");
      var objMapImage = document.getElementById("mapImage");

      objMapImage.src = objHiddenImage.value

    }
  • Re: IE progress bar never stops incrementing...

    11-01-2006, 2:09 AM

    Try to change the codes as the following in Page_Load event handler.

            Dim resultRefresh, urlImage
            Dim mConnector As New aims.ArcIMSConnector

            If Not IsPostBack Then
                mMap = Server.CreateObject("aims.Map")
                mConnector = Server.CreateObject("aims.ArcIMSConnector")
                mConnector.ServerName = "csfdcrw"
                mConnector.ServerPort = 5300

                resultInit = mMap.InitMap(mConnector, "Internal")
                resultRefresh = mMap.Refresh()

                urlImage = mMap.GetImageAsUrl()
                Me.mapImageSrc_hidden.Value = urlImage
            End If
     

  • Re: IE progress bar never stops incrementing...

    11-01-2006, 9:48 AM
    • Member
      139 point Member
    • corn29
    • Member since 06-07-2006, 10:10 AM
    • Posts 48
    Thanks for the reply.... I tried your suggestion but I got the same results as when I tried using Page.IsPostBack (see my first post).  Apparently, there's no difference between IsPostBack and Page.IsPostBack in this case... I'm still having the same problems. My gut tells me there is some contention between the JavaScript onload and the codebehind's Page_Load... I just can put my finger on it!
Page 1 of 1 (3 items)