FormView - set mode in aspx based on url param

Discussion in 'ASP .Net Web Controls' started by David Thielen, Jun 16, 2006.

  1. Hi;

    I would like my FormView to be in Edit/Insert mode depending on if there is
    a username=abc (not abc specifically, just that there is a username=) in the
    url. Or that my ObjectDataSource select finds something. If it's there, it's
    edit mode. Otherwise it's insert mode.

    At present I am doing:
    if (! IsPostBack)
    {
    if (Request.QueryString["username"] != null)
    EditUser.ChangeMode(FormViewMode.Edit);
    else
    EditUser.ChangeMode(FormViewMode.Insert);
    }

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com
    David Thielen, Jun 16, 2006
    #1
    1. Advertising

  2. Hi Dave,

    I think your current approach is reasonable. Is there anything else you
    worry about this?

    Regards,

    Steven Cheng
    Microsoft MSDN Online Support Lead


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Jun 16, 2006
    #2
    1. Advertising

  3. No - just was wondering if it could be done in the aspx part.

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com



    "Steven Cheng[MSFT]" wrote:

    > Hi Dave,
    >
    > I think your current approach is reasonable. Is there anything else you
    > worry about this?
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft MSDN Online Support Lead
    >
    >
    > ==================================================
    >
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    >
    > ==================================================
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    David Thielen, Jun 16, 2006
    #3
    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. Geathaa
    Replies:
    2
    Views:
    689
    Geathaa
    Jul 30, 2003
  2. John J Lee
    Replies:
    3
    Views:
    470
    bruno at modulix
    Dec 1, 2005
  3. ectoplasm
    Replies:
    12
    Views:
    635
    Zorro
    Jul 28, 2005
  4. jobs at webdos
    Replies:
    0
    Views:
    463
    jobs at webdos
    Oct 9, 2006
  5. Dave
    Replies:
    5
    Views:
    650
    John Bokma
    Apr 26, 2011
Loading...

Share This Page