Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Better way than Label to use function to replace text in web page?

Reply
Thread Tools

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

 
 
Kent P. Iler
Guest
Posts: n/a
 
      04-30-2005
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
----------------------------------------------------------------------

Please CC: all replies via e-mail
Remove .NOSPAM from e-mail address


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      04-30-2005
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!
>




 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      04-30-2005
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" <> wrote in message
news:BaadnaW5LqxFjenfRVn-...
> 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
> ----------------------------------------------------------------------
>
> Please CC: all replies via e-mail
> Remove .NOSPAM from e-mail address
>



 
Reply With Quote
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      05-01-2005
Memo fields then i think you must be using MS ACCESS!


*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
kentiler
Guest
Posts: n/a
 
      05-03-2005
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!
> >


 
Reply With Quote
 
kentiler
Guest
Posts: n/a
 
      05-03-2005
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

 
Reply With Quote
 
kentiler
Guest
Posts: n/a
 
      05-03-2005
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

 
Reply With Quote
 
Brock Allen
Guest
Posts: n/a
 
      05-03-2005
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!
>>>




 
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
Is a blank at the end of a C file a better style than a newline atthe end of the file or is it better to place none? Jimmy C Programming 3 09-09-2011 10:36 PM
GL2 better than the XLs? Consumer grade HDs better than pro-sumer Mini DVs? dh@. DVD Video 1 08-28-2008 07:20 PM
dll config and web.config and Label Expressions (binding label text to dll config settings) CSharpner ASP .Net 0 04-09-2007 09:00 PM
Is splint really better than lint? Is there a better tool than splint? Peter Bencsik C Programming 2 09-21-2006 10:02 PM
Build a Better Blair (like Build a Better Bush, only better) Kenny Computer Support 0 05-06-2005 04:50 AM



Advertisments