Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form view/edit

Status
Not open for further replies.

kaijanm

Programmer
May 14, 2003
102
US
I'm curious is there is a convenient way to create an aspx form and have it show as either edit mode or view mode (they have this option is Access)

I want the users to be able to go to a screen to view the information, but then have to click a button to be able to edit it. I'd like to do this with only one form, so I don't have to create/maintain two forms. I think there is a lock property on a control, but I'd have to unlock/lock a LOT of controls if I did this for all of them individually.

Thanks in advance! Any ideas would be most appreciated! :)
 
I honestly don't know if this is the best way, but I've used it.

Here's an example:
Code:
<asp:panel id=editform runat=server>
<asp:textbox id=tb1 runat=server></asp:textbox>
<asp:textbox id=tb2 runat=server></asp:textbox>
</asp:panel>
<asp:panel id=viewform runat=server>
<asp:Label id=lbl1 runat=server></asp:label>
<asp:Label id=lbl2 runat=server></asp:label>
</asp:panel>

or something to that effect... basically one of your panels is the edit form with all the form controls, the other is just a static form with labels or static text if thats all you need. just set the visible property of each panel based on whatever condition you are using to determine if they can edit or not. Its technically all in one form tag, so its only one place to go to maintain...

hth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top