I am trying to set a default button in my ASPX page. I have a master page so the form is there. I have a panel in the content page that holds a table that organizes a number of textboxes, dropdowns and other inputs. The last row of the table holds some buttons, one of which I want to be the default button. After doing some research, I have tried the following with no success.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
pnlHolder.DefaultButton = cmdSearchJob.ClientID
I have also tried
pnlHolder.DefaultButton = cmdSearchJob.UniqueID
and
Dim cmdDef As Button = pnlHolder.FindControl("cmdSearchJob")
pnlHolder.DefaultButton = cmdDef.UniqueID
but both give "The DefaultButton of 'pnlHolder' must be the ID of a control of type IButtonControl." as an error.
I have seen some Javascript solutions, but was hoping to just be able to set the defaultButton for the panel.
Thanks