Page.Controls to identify server controls

K

KK

Hi

I have a webform. To enter data, there are couple of text boxes,
check boxes, select boxes etc.. Data will get collected and saved.
When user want to see the data(not edit) I thouht of showing the
same form. at that point, all the edit boxes, check boxes, list boxes
etc.. will get hidden and labels in those places will get shown.

For this next to every editable control I have a label. The problem
now is, when I ask the form to show it in VIEW form it should
iterate though all the controls and hide the editable controls and
set the visibility of labels to true.

I am having a problem of doing that iterating through the
Page.Controls collection.

Is there a better way to do this? I am trying to avoid 2 forms(one to
edit and one to display because database logic is almost same)

Thanks
KK
 
H

Hermit Dave

or how about putting the labels and textboxes in two seperate panels...
and then toggle the visibility of panel based on whether its read or edit.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top