This is a migrated thread and some comments may be shown as answers.

Ajax Manager and submit buttons.

3 Answers 184 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
John Fetherolf
Top achievements
Rank 1
John Fetherolf asked on 20 Feb 2008, 09:25 PM
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> 
 

3 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 2
answered on 24 Feb 2008, 01:35 AM
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.
0
John Fetherolf
Top achievements
Rank 1
answered on 24 Feb 2008, 03:30 AM
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.
0
Manoj
Top achievements
Rank 1
answered on 11 Oct 2010, 11:36 AM
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
Tags
Ajax
Asked by
John Fetherolf
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 2
John Fetherolf
Top achievements
Rank 1
Manoj
Top achievements
Rank 1
Share this question
or