Home All Groups Group Topic Archive Search About

FormView - set mode in aspx based on url param

Author
16 Jun 2006 3:08 AM
David Thielen
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

Author
16 Jun 2006 11:45 AM
Steven Cheng[MSFT]
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.)
Author
16 Jun 2006 7:57 PM
David Thielen
No - just was wondering if it could be done in the aspx part.

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



Show quoteHide quote
"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.)
>
>