Setting the Default Button - ASP.Net

Simple Save Button

if (mainForm != null)
    mainForm.DefaultButton = uxSaveButton.UniqueID;

Login Control

HtmlForm mainForm = (HtmlForm)Master.FindControl("form1");

Button defaultButton = (Button)uxLoginControl.FindControl("LoginButton");
if (mainForm != null && defaultButton != null)
    mainForm.DefaultButton = defaultButton.UniqueID;

ChangePassword Control

HtmlForm mainForm = (HtmlForm)Master.FindControl("form1");

if (mainForm != null)
{
	Control c = uxChangePasswordControl.FindControl("ChangePasswordContainerID");

	if (c != null)
	{
		Button defaultButton = (Button)c.FindControl("ChangePasswordPushButton");
		if (defaultButton != null)
			mainForm.DefaultButton = defaultButton.UniqueID;
	}
}

RequestNewAccount Control

HtmlForm mainForm = (HtmlForm)Master.FindControl("form1");

if (mainForm != null)
{
	Control c = uxCreateUserWizard.FindControl("__CustomNav0");

	if (c != null)
	{
		Button defaultButton = (Button)c.FindControl("StepNextButton");
		if (defaultButton != null)
			mainForm.DefaultButton = defaultButton.UniqueID;
	}
}

PasswordRecovery Control

HtmlForm mainForm = (HtmlForm)Master.FindControl("form1");

if (mainForm != null)
{
	Control c = uxPasswordRecovery.FindControl("UserNameContainerID");

	if (c != null)
	{
		Button defaultButton = (Button)c.FindControl("SubmitButton");
		if (defaultButton != null)
			mainForm.DefaultButton = defaultButton.UniqueID;
	}
}