How to set default focus for a control in form
FormDefaultFocus.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>How to set default focus for a control in form</title>
</head>
<body>
<form id="form1" runat="server" defaultfocus="TextBox2">
<div>
<h2 style="color:Navy">Form defaultfocus Property</h2>
<asp:Label
ID="Label1"
runat="server"
Font-Bold="true"
ForeColor="DarkGreen"
Text="Employee Name"
>
</asp:Label>
<asp:TextBox
ID="TextBox1"
runat="server"
BackColor="DarkGreen"
>
</asp:TextBox>
<br />
<asp:Label
ID="Label2"
runat="server"
Font-Bold="true"
ForeColor="DarkGreen"
Text="National ID"
>
</asp:Label>
<asp:TextBox
ID="TextBox2"
runat="server"
BackColor="DarkGreen"
>
</asp:TextBox>
<br /><br />
<asp:Button
ID="Button1"
runat="server"
Font-Bold="true"
ForeColor="DarkGreen"
Text="Submit"
/>
</div>
</form>
</body>
</html>
- How to get web server installed font collection in asp.net
- How to get color name list in asp.net
- How to add cell and column in a table programmatically
- How to create a color from ARGB value programmatically in asp.net
- How to use custom image as bullet style in BulletedList
- How to use custom image in TreeView Control
- How to use themes and skins in asp.net