Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page.Controls to identify server controls

Reply
Thread Tools

Page.Controls to identify server controls

 
 
KK
Guest
Posts: n/a
 
      01-25-2004
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


 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      01-25-2004
Why not explicitly show and hide the controls?

"KK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Hermit Dave
Guest
Posts: n/a
 
      01-25-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does javascript identify controls on asp.net pages? COHENMARVIN@lycos.com ASP .Net 2 05-06-2008 09:04 PM
Difference in Web server Controls and HTML Server Controls =?Utf-8?B?c2lhag==?= ASP .Net 7 03-07-2005 07:15 PM
HTML Server Controls vs Web Server Controls brian ASP .Net Web Controls 1 01-24-2005 05:13 AM
How to identify KB 835680 (application-latency) on server? OK in S =?Utf-8?B?YWdlaG0=?= ASP .Net 0 09-20-2004 03:15 PM
Can't identify Windows 9x computers on W2000 server network? fission Computer Support 6 05-12-2004 05:28 PM



Advertisments