Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<script language=javascript>
function setFocus(){
document.getElementById("myTextBox").focus();
}
</script>
...........
<asp:TextBox id="myTextBox" runat=server />
<asp:Button ID="myButton" runat=server Text="Set Focus" />
code behind:
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
if(myButton.Attributes[''onclick''] == null)
{
myButton.Attributes.Add("onclick", "javascript:setFocus()");
}
}