Change Labels to Textboxes easily?

K

Ken McCrory

I have a web form page (.aspx) with 95 label controls that I now need to be
text boxes. Is there an easy way to change those to what I want using
something like a find and replace or am I stuck "changing" each one by hand
by deleting the label and dragging a text box in its place?

Alternatively, the reason I think I need text boxes is that I need to pass
the info in the labels to another page and its not working unless I use a
text box. Is there a way to pass info from labels to another page?

Which problem is easier to solve?

Ken "BiggMakk" McCrory
 
K

Kevin Spencer

Hi Ken,

Your question is difficult to answer as you've asked it. So far, we know
that your requirements are:

1. You have a page with labels in it containing some sort of data from some
unknown source.
2. You need to "pass the info" in the labels to another page.

These requirements are not complete enough to give a good answer to. First,
where is all this data coming from? Second, what is it for (what do you need
it for)? Is it data that is input by the user? I ask this because apparently
it is not, and a form text box is an input device for the user to input
data. If the data doesn't change, using a form field is a bad idea.

So, backing away for a moment from your interface design, we need to know
what the app is supposed to be doing with this data. The interface design is
dependent upon the business requirements for your app.

For example, assuming that these labels are populated on the server, what is
the requirement that dictates that they should be "passed" to another page?
The other page is on the server as well, and could well grab the data from
the same location on the server as the first page. Can you provide more
information about your specific requirements?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
K

Ken McCrory

This page is a confirmation page of registration information. The labels are
populated from the registration form page using the Request.Params method.
The user process here is (1) fill out the registration form, (2) that info
gets passed to the confirmation page (this page in question) for
confirmation (3) if the user confirms this information then it will get
written to a database and the info gets sent to another page for credit card
processing. HOWEVER, something you said may be another possibility. I could
just write it to the database and on the next page retrieve it back from the
database. I'm going to have to do a query anyway to get the registration
number that the database automatically assigned when the record was written.
I'll still need to pass enough info to perform a SELECT to get the record
back from the database but that's a lot fewer fields than the entire form.

There's still some ways I could have done this better from the beginning but
now I'm in a time crunch to get this online for use so anything that works
is probably going to be the "quickest".

Thanks for the help, past and future.

Ken "BiggMakk" McCrory
 
R

recoil

If you need a "edit" and a "preview" page then you could simply just
have a special CSS attribute.
When you are in preview mode set the parent Container to disabled and
using CSS apply a borderless style to your input elements.
try using the following to help give you a better idea of what you
might want to look at.

<asp:panel Id="bleha" CssClass="myparent">


..myparent input { border:0px; }
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top