Its simple but not working,why?
I have two textbox and dropdownlist in vb.net web application.
I want to focus cursor on dropdownlist on page load
In pageload I wrote code as
DropDownList1.Focus()
But cursor is not focusing,why?
urgent,pls
Try this
<asp:TextBox runat="server" /> <asp:DropDownList ID = "DropDownList1" runat="server"> <asp:ListItem Text="text1" /> <asp:ListItem Text="text2" /> </asp:DropDownList> <script type = "text/javascript"> window.onload = function () { document.getElementById("<%=DropDownList1.ClientID %>").focus(); }; </script>
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.