FormView - set mode in aspx based on url param

D

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);
}
 
S

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top