SetFocus gridview control

P

postings

Hi

I'm trying to set the focus to a textbox situated in the footer of a
gridview, when the page is loading. (note textbox is in a template).

So far I've got:
-------------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

Page.SetFocus(gvPortfolio.FooterRow.FindControl("txtName"))

End Sub
-------------------------------

Unfortunately this comes up with yellow screen of death:

"System.InvalidOperationException: The DefaultButton of 'form1' must be
the ID of a control of type IButtonControl."

Any ideas?

Thanks

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top