Ext.Net, UpdatePanel and Panel Javascript Error

  1. #1

    Ext.Net, UpdatePanel and Panel Javascript Error

    Hello,

    I have inside an updatepanel a panel with a button and textfield. When I clicked the button, after the Postback, the following javascript error appears in the browser

    Error: Syntaxerror
    Ext.onReady(function(){if (Ext.query("div[id=Panel1_Container].AsyncRender").length>0){Ext.net.ResourceMgr.destroyCmp("Panel1");Ext.create("Ext.panel.Panel",{"id":"Panel1","renderTo":"Panel1_Container","items":[<#:anchor id="txtTime_ClientInit" />,<#:anchor id="cmdAdd_ClientInit" />] ....
    I use the following component-versions

    Ext.Net 2.4.0.30143
    .Net Framework 4.5.1
    Windows 7 x64
    Default.aspx

    <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <ext:resourcemanager id="SCM" runat="server" enableviewstate="true" disableviewstate="false"
            initscriptmode="Inline" clientidmode="Predictable" namespace="" quicktips="true"
            renderscripts="Embedded"></ext:resourcemanager>
        <div style="position: relative;">
            <ext:TextField ID="txtTimeOutside" runat="server" FieldLabel="Time outside"></ext:TextField>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false"
                EnableViewState="true">
                <contenttemplate>
                    <ext:Panel ID="Panel1" runat="server" >
                        <Items>
                        <ext:TextField ID="txtTime" runat="server" FieldLabel="Time"></ext:TextField>
                        <ext:Button  ID="cmdAdd" runat="server" Icon="Add" Text="Submit" AutoPostBack="true"></ext:Button>
    
                            </Items>
                        </ext:Panel>
                </contenttemplate>
            </asp:UpdatePanel>
        </div>
    Default.vb

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            If IsPostBack = False Then
                txtTime.Text = Now
                txtTimeOutside.Text = Now
            End If
    
        End Sub
    
        Private Sub cmdAdd_Click(sender As Object, e As EventArgs) Handles cmdAdd.Click
    
            txtTime.Text = Now
    
            UpdatePanel1.Update()
    
            ' Error
            SCM.AddUpdatePanelToRefresh(UpdatePanel1)
    
            ' Script is correct
            ' Panel1.toScript()
    
        End Sub
    When I checked the script in the button-event with the following code line

    Panel1.toScript()
    I got a correct script.

    Can everyone help me.
    Last edited by geoffrey.mcgill; Feb 17, 2014 at 3:09 PM. Reason: Please use [CODE] tags
  2. #2
    Hi,

    Is there any particular reason why you need to use an UpdatePanel? We highly recommend you remove from your project. There is *always* a better option to the UpdatePanel.
    Geoffrey McGill
    Founder
  3. #3
    Hello,

    thank you for your answer. In the current project I want to change from the Ext version 1.5 to the latest version, without rewrite the whole program. I also want to keep the effort for testing low.
  4. #4
    Quote Originally Posted by Woyciniuk View Post
    Hello,

    thank you for your answer. In the current project I want to change from the Ext version 1.5 to the latest version, without rewrite the whole program. I also want to keep the effort for testing low.
    The UpdatePanel is not the answer to your requirements. I highly recommend you remove as many instances of the UpdatePanel from your Project as you can. There are much better options that require less code and are more robust solutions.

    Mixing of these (very) old school ASP.NET techniques with an Ext.NET application (or any modern application) is going to yield unexpected results and make testing difficult. Your requirements for an easy upgrade are undermined by the decision to use UpdatePanel.

    Our official policy on the UpdatePanel is the following:

    UpdatePanel: It works, except when it doesn't.


    If the UpdatePanel works in your Ext.NET application, then great. If it doesn't, then there's probably not much support we can provide.

    We're also thinking about completely removing all support for UpdatePanel from Ext.NET 3. There's just no need to have that kind of bloat inside the framework, and we do not want to encourage developers to use the UpdatePanel, so it's probably best if we remove support.
    Last edited by geoffrey.mcgill; Feb 04, 2015 at 3:18 AM.
    Geoffrey McGill
    Founder
  5. #5
    Hello,

    Thanks for the information. I'll think now, what are the options for the conversion.

    Thanks for the help, please mark this thread as closed.

Similar Threads

  1. [CLOSED] Print a grid panel javascript error
    By otouri in forum 2.x Legacy Premium Help
    Replies: 19
    Last Post: Nov 01, 2012, 6:30 PM
  2. Replies: 2
    Last Post: May 30, 2011, 5:53 AM
  3. [CLOSED] [1.0] Panel collapse from javascript giving error
    By vedagopal2004 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 08, 2010, 6:23 AM
  4. Replies: 2
    Last Post: Jul 01, 2009, 1:06 PM
  5. IE7 Update Panel javascript error with Mono
    By cristianpsg in forum Bugs
    Replies: 0
    Last Post: Apr 30, 2009, 1:27 PM

Tags for this Thread

Posting Permissions