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. Advertisements

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:
    745
    dmedina
    Jun 30, 2003
  2. jamess

    asp setfocus and performance

    jamess, Oct 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    532
    Saravana [MVP]
    Oct 30, 2003
  3. jaffer the but

    setfocus eh ! help

    jaffer the but, Apr 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    671
    Lars Netzel
    Apr 14, 2004
  4. Mad Scientist Jr

    asp.net setfocus after validation not working

    Mad Scientist Jr, Jul 13, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    6,997
    Mad Scientist Jr
    Jul 15, 2004
  5. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,249
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  6. Haobing
    Replies:
    1
    Views:
    1,142
    Haobing
    Dec 20, 2005
  7. trint
    Replies:
    4
    Views:
    608
    trint
    Sep 22, 2007
  8. Eric

    Setfocus to control in Iframe

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