ASP.Net 2.0 FormView - Set Focus To Control On EditItemTemplate

Discussion in 'ASP .Net' started by Dan Sikorsky, Jun 16, 2006.

  1. Dan Sikorsky

    Dan Sikorsky Guest

    My ASP.Net 2.0 FormView has an EditItemTemplate, an InsertItemTemplate and
    an ItemTemple. When the page first loads, the ItemTemplate shows with an
    Edit button. If the user clicks the Edit button, the postback loads the
    EditItemTemplate, but with NO focus on any control on the EditItemTemplate.

    How can I set the focus to the first textbox on the EditItemTemplate when
    the page postsback?
    --
    Dan Sikorsky, MSCS BSCE BAB
    Dan Sikorsky, Jun 16, 2006
    #1
    1. Advertising

  2. Dan Sikorsky

    Brock Allen Guest

    You'd have to manually set focus with Page.Form.SetFocus

    -Brock
    http://staff.develop.com/ballen


    > My ASP.Net 2.0 FormView has an EditItemTemplate, an InsertItemTemplate
    > and an ItemTemple. When the page first loads, the ItemTemplate shows
    > with an Edit button. If the user clicks the Edit button, the postback
    > loads the EditItemTemplate, but with NO focus on any control on the
    > EditItemTemplate.
    >
    > How can I set the focus to the first textbox on the EditItemTemplate
    > when the page postsback?
    >
    Brock Allen, Jun 17, 2006
    #2
    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. Colin Basterfield

    Set Focus in EditItemTemplate text box...

    Colin Basterfield, Jun 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    435
    Cosmin Marin
    Jun 8, 2004
  2. =?Utf-8?B?RGFuIFNpa29yc2t5?=

    HOWTO: Detect FormView EditItemTemplate TextBox Value Changed

    =?Utf-8?B?RGFuIFNpa29yc2t5?=, Oct 4, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    656
    =?Utf-8?B?RGFuIFNpa29yc2t5?=
    Oct 4, 2006
  3. mark d.
    Replies:
    0
    Views:
    833
    mark d.
    Oct 6, 2006
  4. Replies:
    1
    Views:
    837
    Mufasa
    May 19, 2008
  5. Roger
    Replies:
    3
    Views:
    299
Loading...

Share This Page