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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top