SetFocus gridview control

Discussion in 'ASP .Net Web Controls' started by postings@alexshirley.com, Oct 4, 2006.

  1. Guest

    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
     
    , Oct 4, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jurjen de Groot

    SetFocus

    Jurjen de Groot, Jun 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    632
    dmedina
    Jun 30, 2003
  2. jamess

    asp setfocus and performance

    jamess, Oct 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    449
    Saravana [MVP]
    Oct 30, 2003
  3. Haobing
    Replies:
    1
    Views:
    1,068
    Haobing
    Dec 20, 2005
  4. trint
    Replies:
    4
    Views:
    428
    trint
    Sep 22, 2007
  5. Eric

    Setfocus to control in Iframe

    Eric, Aug 25, 2010, in forum: ASP .Net
    Replies:
    0
    Views:
    809
Loading...

Share This Page