in my web application i have a master page and i want to implement defaultbutton for a login page when user press enter (my application has Master page) how can i place default button.
In a GUI (graphical user interface), such as in Microsoft Windows, the default button is the button chosen if you press Enter on the keyboard. This button represents the option you are most likely to choose, or which is safest to choose if you press Enter accidentally.
Button Type in ASP.NET Button ControlButton is used as normal click button, submitting form data, resetting the form data to its initial value. According to the usage of button, you can render the button in three types. By using the Type property, you can easily render the button in following types.
ASP.NET provides three types of button control: Button : It displays text within a rectangular area. Link Button : It displays text that looks like a hyperlink. Image Button : It displays an image.
Page.Form.DefaultButton = crtlLoginUserLogin.FindControl("LoginButton").UniqueID
or just
Page.Form.DefaultButton = LoginButton.UniqueID
This will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With