Ajax Manager and submit buttons.

4 posts, 0 answers
  1. John Fetherolf
    John Fetherolf avatar
    30 posts
    Member since:
    Sep 2006

    Posted 20 Feb 2008 Link to this post

    I have a simple login page with the standard user name, password, and login button with UseSubmitBehavior="true".  If I add a RadAjaxManager the HTML tag for the button gets set to type="button" instead of type="submit".  Why is this?  How do I get a submit button on an ajaxified page?  I would like users to be able to hit <enter> to invoke the submit button.

    Thanks,
    Kevin

    <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">  
        <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="btnLogin">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="btnLogin" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManagerProxy> 
          
        <table class="content" cellpadding="0" cellspacing="0" style="width: 100%;">  
            <tr> 
                <td class="controlLabel" style="width: 10%;">Login:</td> 
                <td> 
                    <asp:TextBox runat="server" ID="editLogin" Columns="40"></asp:TextBox> 
                    <span class="controlLabel">@KimballMidwest.com</span> 
                </td> 
            </tr> 
            <tr class="spacerRow"><td></td></tr> 
            <tr> 
                <td class="controlLabel">Password:</td> 
                <td> 
                    <asp:TextBox runat="server" ID="editPassword" Columns="40" TextMode="Password"></asp:TextBox> 
                </td> 
            </tr> 
            <tr> 
                <td></td>  
                <td class="controlLabel">  
                    <asp:CheckBox runat="server" ID="chkRememberMe" Text="Remember Me" /> 
                </td> 
            </tr> 
            <tr class="spacerRow"><td></td></tr> 
            <tr> 
                <td></td>  
                <td class="controlLabel">  
                    <asp:Button runat="server" ID="btnLogin" Text="Login" style="width: 80px;" OnClick="btnLogin_Click"   
                        UseSubmitBehavior="true"/>  
                </td> 
            </tr> 
        </table> 
    </asp:Content> 
     
  2. Michael
    Michael avatar
    58 posts
    Member since:
    Jan 2008

    Posted 23 Feb 2008 Link to this post

    Hi Kevin,

    I'm not too familiar with the Proxy control you're using, but you can easily achieve the desired effect by:

    1.) Wrapping your login form with a RadAjaxPanel.
    2.) Wrapping your login form with a regular Panel server control in addition to the RadAjaxPanel and set the "DefaultButton" property to the name of your button.

    I tried this out on my machine and it works like a charm.  Hope this helps.
  3. John Fetherolf
    John Fetherolf avatar
    30 posts
    Member since:
    Sep 2006

    Posted 23 Feb 2008 Link to this post

    I was able to work around the problem.  I verified that UseSubmitBehavior uis set to true in the Page_Load event, but by the time the AjaxSettingCreating event fires on RadAjaxmanager the property on the server side control had been set to false.  So I just let my content page save off its submit button and changed UseSubmitBehavior back to true in the AjaxSettingCreating event.  Was a pain, but it worked.
  4. Manoj
    Manoj avatar
    11 posts
    Member since:
    Jul 2010

    Posted 11 Oct 2010 Link to this post

    Hi John,

    I am facing the same issue. Would you be able to share how to wire the event to the event handler you mentioned in your latest reply? I am pasting the code in the aspx page we are having where we are configuring the controls in the AjaxSetting.

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxyCustomerPage" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnSearch">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="CustomerGrid" UpdatePanelHeight=""
            LoadingPanelID="RadAjaxLoadingPanelCustomer" />
        </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="chkIncludeDeprecated">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="CustomerGrid" UpdatePanelHeight=""
            LoadingPanelID="RadAjaxLoadingPanelCustomer" />
        </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelCustomer" runat="server"
    Skin="Default" InitialDelayTime="200" MinDisplayTime="300">
    </telerik:RadAjaxLoadingPanel>

    The submit button starts working absolutely fine after I remove/comment the following block from the AjaxSettings.
    <telerik:AjaxSetting AjaxControlID="btnSearch">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="CustomerGrid" UpdatePanelHeight=""
        LoadingPanelID="RadAjaxLoadingPanelCustomer" />
    </UpdatedControls>
    </telerik:AjaxSetting>

    Thanks,
    Manoj
Back to Top