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

Button server side focus method

1 Answer 59 Views
Button
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 04 Mar 2015, 06:26 PM
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

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 05 Mar 2015, 12:13 PM
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.

 
Tags
Button
Asked by
Robert
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or