Button server side focus method

2 posts, 0 answers
  1. Robert
    Robert avatar
    198 posts
    Member since:
    Aug 2009

    Posted 04 Mar 2015 Link to this post

    Does anyone have a resolution for the RadButton not being focused on a Page_Load event?

    ASP button you can set the .focus() in the page load event and it is truly focused when the page is displayed.  RadButton doesn't work.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="buttonnoworkie.aspx.vb" Inherits="buttonnoworkie" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
          <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="false">
      </telerik:RadScriptManager>
        <div>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>
       <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton"
            ResolvedRenderMode="Classic">
      </telerik:RadButton>  
        </div>
        </div>
        </form>
    </body>
    </html>


    Partial Class buttonnoworkie
        Inherits System.Web.UI.Page
     
      Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        RadButton1.Focus()
      End Sub
    End Class

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 05 Mar 2015 Link to this post

    Hello Robert,

    You can try to register a startup script from the server that focuses the button on the client.

    Regards,
    Danail Vasilev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top