Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Problem using WebTab with Scriptmanager
posted

Hi,
I have made a simple WebAppl with an Ultrawebtab and 3 Pages.
The 3 Pages are called with the Eventhandler:
        void UltraWebTab1_TabClick(object sender, Infragistics.WebUI.UltraWebTab.WebTabEvent e){
            switch (e.Tab.Key){
                case "0": e.Tab.ContentPane.TargetUrl = "Page1.aspx"; break;
                case "1": e.Tab.ContentPane.TargetUrl = "Page2.aspx"; break;
                case "2": e.Tab.ContentPane.TargetUrl = "Page3.aspx"; break;}}
So far it works well.

But when I add a scriptmanager to the 3 pages, I got an error:
 in line 997 of MicrosoftAjaxWebForms.debug.js:
  if (!this._postBackSettings.async) {
Errormessage: 'this._postBackSettings.async' is null or not an object
Any help?

Enviroment: MSVS2008 C# Framework 3.5 and Infragistics35.WebUI.UltraWebTab.v8.1

  • 5
    posted

    I had the same issue.  It would only occur if you navigate to a tab and then navigate away from the tab without clicking on any control in the tab.  Let me reword that.  If you goto and then leave a tab without clicking on any of the controls the problem occurs.  The way I fixed this was with the following code.

     

    <button id="oButton" style="display:none" onclick="this.innerText='I have been clicked!'">Button</button>
    <script type="text/javascript" language="javascript">
    document.getElementById('oButton').fireEvent("onclick");
    </script>

    or here is a version of the same thing that I now use in a base page class so that it works for all my pages. 

    string script = @"<script type=""text/javascript"" language=""javascript"">
    Sys.Application.add_load(DoLoad {
    // This is here to get rid of an odd bug in the Ultra tab control from Infragistics.
    // If you don't click on the page you navigate to before navigating away from it, a javascript error will be thrown
    var form = document.forms[0];
    var myMsg = ""I have been clicked"";
    var myButt = document.createElement(""button"");
    myButt.id = ""oButton1"";
    myButt.style.display = ""none"";
    myButt.onclick = ""this.innerText='I have been clicked'"";
    form.appendChild(myButt);
    myButt.fireEvent(""onclick"");
    }
    </script>"
    ;

     

    ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), script, false);

     

  • 65
    posted

    Okay, here my solution:

        <script type="text/javascript">

        function UltraWebTab1_onInitTab(sender, eventArg2, eventArg3)
        {
            var page = "Page1.aspx";
            var index = 0;
           
            var nam = sender.ID + "_frame" + index;
            document.getElementById(nam).style.cssText = "DISPLAY:block";
            document.getElementById(nam).contentWindow.location.href = page;
            document.getElementById(nam).contentWindow.document.frames[index].location.href = page;
            document.getElementById(nam).contentWindow.location.reload(true);
        }
       
        function UltraWebTab1_onTabClick(sender, item, event)
        {
            var page;
            switch (item.Key)
            {
                case "0":
                    page = "Page1.aspx";
                    break;
                case "1":
                    page = "Page2.aspx";
                    break;
                case "2":
                    page = "Page3.aspx";
                    break;
            }
            var nam = sender.ID + "_frame" + item.Key;
            document.getElementById(nam).style.cssText = "DISPLAY:block";
            document.getElementById(nam).contentWindow.location.href = page;
            document.getElementById(nam).contentWindow.document.frames[item.index].location.href = page;
            document.getElementById(nam).contentWindow.location.reload(true);
        }
       </script>
     
    <igtab:UltraWebTab ID="UltraWebTab1" runat="server" AutoPostBack="false">
        <ClientSideEvents Click="UltraWebTab1_onTabClick"
         InitializeTabs="UltraWebTab1_onInitTab" />
        <Tabs>
            <igtab:Tab Key="0" AccessKey="0" Text="Page1" />
            <igtab:Tab Key="1" AccessKey="1" Text="Page2" />
            <igtab:Tab Key="2" AccessKey="2" Text="Page3" />
        </Tabs>
    </igtab:UltraWebTab>

    Thanks for congratulations!