Validation not working when asp control added

  1. #1

    Validation not working when asp control added

    Hi,

    We need to include an asp control in a panel which also includes validation but when we add the asp control ext.net validation no longer works. Here is an example, when I enter a value in TextField1 field, Button1 stays disabled:

    <%@ Page Language="C#" %>
    <%@ Import Namespace="Ext.Net.Utilities" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" DisableViewState="false" runat="server" />
        <ext:Panel ID="Panel2" runat="server" Title="Editor" Height="200" Width="500">
            <Content>
                <ext:FormPanel ID="FormPanel2" runat="server" Frame="true" MonitorValid="true" Height="150" Width="500">
                    <Content>
                        <ext:Container ID="Container1" runat="server" Title="Information">
                            <Content>
                                <ext:TextField ID="TextField1" runat="server" Width="200" FieldLabel="First Name" AllowBlank="false" />
                                <asp:FileUpload ID="fileupload1" runat="server" />
                            </Content>
                        </ext:Container>
                    </Content>
                    <Buttons>
                        <ext:Button ID="Button1" runat="server" Text="Save" Disabled="true">
                        </ext:Button>
                        <ext:Button ID="Button2" runat="server" Text="Close">
                        </ext:Button>
                    </Buttons>
                    <Listeners>
                        <ValidityChange Handler="#{Button1}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
            </Content>
        </ext:Panel>
        </form>
    </body>
    </html>
    How do I modify the code so Button1 is enabled when I enter a value into TextField1?

    Thanks for your help,
    Swanny.
  2. #2
    Validation logic works for Items only, Content is not validatable
    If Content has Ext.net controls only then Content is transformed to Items but if you add asp control then such transfortmation is not performed
    Wrap asp control by separate Container and use Items as much as possible (instead Content)

Similar Threads

  1. Replies: 6
    Last Post: Jul 11, 2012, 10:20 PM
  2. [CLOSED] BeforeRender is not working when added from code behind
    By Aparna_B in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 18, 2012, 4:08 PM
  3. Replies: 2
    Last Post: Feb 01, 2012, 8:53 PM
  4. [CLOSED] Listeners added for button at code behind is not working
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 31, 2012, 3:32 PM
  5. Replies: 3
    Last Post: Jul 11, 2011, 9:43 AM

Posting Permissions