Thursday, June 2, 2011

How to make default button in page

How to make default button in page

Default button means whenever you press the enter button then event of that button would be fired. If in a page more than one button then you can make anyone to be default button. Some time when there is no default button in the page then user press the default button by mouse not by keyword so default button save the time of user.

protected void Page_Load(object sender, EventArgs e)
{
      Form.DefaultButton = ButtonID.UniqueID;
}

OR


<body defaultButton="ButtonID">

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.