Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

ScriptManager.RegisterStartupScript potentially causing issue with IE

$
0
0

Hello,
i'm using the scriptmanager to call different javascript based on page_load versus postback like so:

    if (!this.IsPostBack)
        {
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RedrawScript", "RedrawMarkup();", true);
        }

if (this.IsPostBack)
        {
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "RefreshScript", "RefreshMap();", true);
        }

Now in IE only (works fine in Firefox), on the page_load the RedrawMarkup() javascript function is getting called. It goes up a frame and calls a function that draws a line. The issue I am having is that about half the time the line cannot be drawn because RedrawMark() never stops to allow you to draw it. It passes right on through to the handler function OnLineDigitized() which then complains about null line values. Since this seems to work fine in Firefox I'm wondering if it has anything to do with the way Scriptmanager behaves in IE7/8. IE is unfortunately our current company standard for browsers.

function RedrawMarkup() {

            var featureStr = parent.GetMapFrame().GetSelectionXML();

            if (featureStr.indexOf("Tenant Space") > -1) {
                document.getElementById("TYPE").value = "Tenant Space";
                parent.GetMapFrame().DigitizeLine(OnLineDigitized);
            }

            else alert("Select a tenant space before attempting to redraw markup.");

        }

        function OnLineDigitized(lineString) {

            document.getElementById("MAP").value = parent.GetMapFrame().GetMapName();
            document.getElementById("SELECTION").value = parent.GetMapFrame().GetSelectionXML();
            document.getElementById("SESSION").value = parent.GetMapFrame().GetSessionId();
            document.getElementById("INNERX").value = lineString.Point(0).X;
            document.getElementById("INNERY").value = lineString.Point(0).Y;
            document.getElementById("OUTERX").value = lineString.Point(1).X;
            document.getElementById("OUTERY").value = lineString.Point(1).Y;
            document.getElementById("form1").submit();

        }


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>