473,503 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page.Controls to identify server controls

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
Nov 18 '05 #1
2 950
Why not explicitly show and hide the controls?

"KK" <kk@kk.com> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #2
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.

--
Regards,
HD
Once a Geek.... Always a Geek
"KK" <kk@kk.com> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3666
by: Kersh | last post by:
I'm trying to implement XHTML standards in my ASP.NET web pages but whenever I use web controls I get problems because of the very strict nature of W3C XHTML (transitional version is picky but...
1
2877
by: panche | last post by:
I'm developing a fairly simple user control that has two textboxes for date/time entry (a from date/time and a to date/time). One of my requirements is that there should be no button that sets...
3
6394
by: ivanpais | last post by:
Hi, I have a Web User Control, Lets say "Foo.ascx", that contains a button "btnFoo". I have a Master Page "Bar.master", that has a label "lblBar". This label is exposed by a public property...
1
3241
by: ChrisFrohlich | last post by:
I am in the early stages of an ASP.NET project and my Architect is proposing a form that would have as many as 1200 (twelve-hundred!) textboxes on a single page. Aside from the usability concerns,...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.