Write Panel's innerText

D

dw

Hello, all. I'm using a Panel to display the values the user entered into a
form upon validation. The panel is mainPanel and its visibility is set to
False server-side until the IsValid returns True. Then I wish to write the
form values out into it. How do I do this? I've looked at the
RenderBeginTag, but is that what I need? Thanks
 
G

Greg Burns

A panel can contain other controls, in particular label controls. Can you
not just write to those, and when you do mainPanel.Visible=True they will
also appear.

I have also seen people add runat=server to <span> elements inside a panel
and then assign text to their innertext property. I believe this is
equivalent to create a label controls and just setting their text property.

Greg
 
D

dw

Thanks, again, Greg. Never thought of using a Label. One more question: How
do you take a name like JANE SMITH when entered by the user and convert it
into Jane Smith? I've got this in the showPanel() sub, but it's not setting
the text of the label inside the Panel to the correct format:

Me.lblLastNamePostback.Text = "Last Name: " &
Request.Form("txtLastName").ToLower().Substring(0, 1).ToUpper()


Thanks for all your help.
 
G

Greg Burns

StrConv("JOHN MCDOE", VbStrConv.ProperCase)

"John Mcdoe"

You can also do something similiar your CSS.

Greg
 
D

dw

Thank you, Greg. Very impressive :) Thank you.

Greg Burns said:
StrConv("JOHN MCDOE", VbStrConv.ProperCase)

"John Mcdoe"

You can also do something similiar your CSS.

Greg
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top