473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Better way than Label to use function to replace text in web page?

Hi,

I'm creating a website where I need to pull data from a database, and
display it on a page. This isn't a place where a repeater or datagrid makes
sense. I was using labels and setting the text equal to the values that I
needed to display. That works OK in most places, but in areas where there
are memo fields requiring multiple lines, a label doesn't cut it.

What would be the best thing to use instead of a label, and allow the
code-behind functions to set the value?

Thanks!

-- Kent Iler
----------------------------------------------------------------------
ke**@iler.NOSPAM.com
Please CC: all replies via e-mail
Remove .NOSPAM from e-mail address
Nov 19 '05 #1
7 1081
Memo fields? So you mean you want the text to wrap? If you, so you can replace
the "\r\n" with "<br/>" with String.Replace.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I'm creating a website where I need to pull data from a database, and
display it on a page. This isn't a place where a repeater or datagrid
makes sense. I was using labels and setting the text equal to the
values that I needed to display. That works OK in most places, but in
areas where there are memo fields requiring multiple lines, a label
doesn't cut it.

What would be the best thing to use instead of a label, and allow the
code-behind functions to set the value?

Thanks!


Nov 19 '05 #2
You could use a TextBox with its Multiline property set to true.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Kent P. Iler" <ke**@iler.NOSPAM.com> wrote in message
news:Ba********************@comcast.com...
Hi,

I'm creating a website where I need to pull data from a database, and
display it on a page. This isn't a place where a repeater or datagrid
makes sense. I was using labels and setting the text equal to the values
that I needed to display. That works OK in most places, but in areas
where there are memo fields requiring multiple lines, a label doesn't cut
it.

What would be the best thing to use instead of a label, and allow the
code-behind functions to set the value?

Thanks!

-- Kent Iler
----------------------------------------------------------------------
ke**@iler.NOSPAM.com
Please CC: all replies via e-mail
Remove .NOSPAM from e-mail address

Nov 19 '05 #3
Memo fields then i think you must be using MS ACCESS!
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #4
I tried that but it didn't work with a label. Can the label have HTML
in it?

Thanks!

--Kent

Brock Allen wrote:
Memo fields? So you mean you want the text to wrap? If you, so you can replace the "\r\n" with "<br/>" with String.Replace.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I'm creating a website where I need to pull data from a database, and display it on a page. This isn't a place where a repeater or datagrid makes sense. I was using labels and setting the text equal to the
values that I needed to display. That works OK in most places, but in areas where there are memo fields requiring multiple lines, a label
doesn't cut it.

What would be the best thing to use instead of a label, and allow the code-behind functions to set the value?

Thanks!


Nov 19 '05 #5
But I don't know how long the text will be, and so I don't want to do a
fixed number of rows. I want something that will only be as large as
the text, but allow for a significant amount, too - such as 4000+
characters.

Thanks!

--Kent

Nov 19 '05 #6
Yes, Access is the data source in this case, but I'm pulling back the
data from Access and presenting it in a webform using ASP.NET.

--Kent

Nov 19 '05 #7
Of course -- the label just renderes as a <span> with the Text property inside.
Hmm... now that I've mentioned it, what does the spec say about that... Well,
my quick test shows that it's ok. If it doesn't work for you, you can always
use a LiteralControl with the <br> in side of it.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I tried that but it didn't work with a label. Can the label have HTML
in it?

Thanks!

--Kent

Brock Allen wrote:
Memo fields? So you mean you want the text to wrap? If you, so you

can replace
the "\r\n" with "<br/>" with String.Replace.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

I'm creating a website where I need to pull data from a database,
and
display it on a page. This isn't a place where a repeater or
datagrid
makes sense. I was using labels and setting the text equal to the
values that I needed to display. That works OK in most places, but
in
areas where there are memo fields requiring multiple lines, a label
doesn't cut it.

What would be the best thing to use instead of a label, and allow
the
code-behind functions to set the value?

Thanks!


Nov 19 '05 #8

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

Similar topics

5
by: Abby Lee | last post by:
My code does what I want (works unless there is a lot of volume...works for this month cause not a lot of items marked paid yet...) but the page times out for last month because there is just so...
8
by: David McDivitt | last post by:
We have a massive java application to be made ADA compliant. We want onfocus and onblur events for each text field. The best way seems to be javascript, by cycling through all the nodes recursively...
0
by: Giovane Calabrese | last post by:
ok. im try to make a multilanguage system based on that tutorial : http://www.123aspx.com/redir.aspx?res=29112 in my aspx pages all text are in labels , and i want to take the name labels...
1
by: Chad A. Beckner | last post by:
Hey all, I am developing a workshop registration system, and am new to ASP .NET. On my first page, I want to list the "categories" available along with the number of "workshops" related to that...
4
by: tshad | last post by:
I have a textbox that I am storing as text (or as a varChar). The field has multiple lines in it (not wrapped). When I read it back into a multiline textbox, it works fine. But when I read it...
2
by: tshad | last post by:
Is there another way to put labels on a page other than asp:label? I have been building a page where I use a label to display the calculated result of some imput. I do it using Javascript. But...
3
by: PK9 | last post by:
I'm having some issues with using a Response.Write or the shortcut ( <%= ...) from within a label control. I cannot do this in the code behind, I need to do it here at runtime. I have a public...
4
by: Shapper | last post by:
Hello, I have a label as follows: <label id="lName" for="name">Name:<input type="text" id="name"></input></label> I need to declare the label in my page.aspx.vb so I can access it on page...
1
by: COHENMARVIN | last post by:
I have a asp.net page that does something simple - when the user clicks on a radiobutton, a panel becomes visible beneath the radio button. There is some text below the radio button, and that is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.