Default Button for asp:panel

5 posts, 0 answers
  1. kiran
    kiran avatar
    33 posts
    Member since:
    Aug 2008

    Posted 29 May 2009 Link to this post

    Hi Friends,

    i have 2 asp:Panel in the RadAjaxPanel with default buttons set for each panels
    i just want know how to make the default button work when i focus to its appropriate textbox and press enter.
    plzz help aspd

    <telerik:RadScriptManager id="RadScriptManager1" runat="server" EnableTheming="True"></telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel id="RadAjaxLoadingPanel1" Runat="server" Transparency="30" style="background:url('../Images/LoadingTitle.gif') center center no-repeat #f3f3e2;"></telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="CMSRadAPan" runat="server" EnableHistory="True" HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1">
    <asp:Panel ID="pnl1" runat="server" defaultbutton="Button1" style="border:1px outset #abcdef;background-color:#abcdef">
     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
     <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
     <asp:Button ID="Button1" runat="server" Text="Button1" OnClick="Button1_Click" />
    </asp:Panel>

    <asp:Panel ID="Panel1" runat="server" defaultbutton="Button2" style="border:1px outset #fedcba;background-color:#fedcba">   
     <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
     <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>    
     <asp:Button ID="Button2" runat="server" Text="Button2" OnClick="Button2_Click" />
    </asp:Panel>

    </telerik:RadAjaxPanel>


    Thanks

     

     

     

     

  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 01 Jun 2009 Link to this post

    Hello kiran,

    Indeed, when you want to set a DefaultButton to an ajaxified page, you could do it same way as you would without having ajax.
    Could you confirm that the desired functionality works if you set the EnableAjax property of the RadAjaxPanel to false?

    Sincerely yours,
    Iana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Stephen
    Stephen avatar
    1 posts
    Member since:
    Aug 2010

    Posted 11 Aug 2010 Link to this post

    Was there ever a solution for this?  I want to do something similar where I have a default button in one panel after a button has been selected in another, but focus is retained on the newly selected button. 
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 12 Aug 2010 Link to this post

    Hello Stephen,

     Could you please elaborate if you are using Ajax on the page. note that this scenario should be implemented the same way with or without Ajax.
    If Ajax is used on the page you could suggest using the RadAjax Focus() method as described here.

    Sincerely yours,
    Maria Ilieva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 12 Aug 2010 Link to this post

    Hello Stephen,

     Could you please elaborate if you are using Ajax on the page. Note that this scenario should be implemented the same way with or without Ajax.
    If Ajax is used on the page you could suggest using the RadAjax Focus() method as described here.

    Sincerely yours,
    Maria Ilieva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top