Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Better way than Label to use function to replace text in web page? (http://www.velocityreviews.com/forums/t101769-better-way-than-label-to-use-function-to-replace-text-in-web-page.html)

Kent P. Iler 04-30-2005 11:12 PM

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
----------------------------------------------------------------------
kent@iler.NOSPAM.com
Please CC: all replies via e-mail
Remove .NOSPAM from e-mail address



Brock Allen 04-30-2005 11:28 PM

Re: Better way than Label to use function to replace text in web page?
 
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!
>





Steve C. Orr [MVP, MCSD] 04-30-2005 11:38 PM

Re: Better way than Label to use function to replace text in web page?
 
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" <kent@iler.NOSPAM.com> wrote in message
news:BaadnaW5LqxFjenfRVn-rQ@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
> ----------------------------------------------------------------------
> kent@iler.NOSPAM.com
> Please CC: all replies via e-mail
> Remove .NOSPAM from e-mail address
>




Patrick Olurotimi Ige 05-01-2005 12:52 AM

Re: Better way than Label to use function to replace text in web page?
 
Memo fields then i think you must be using MS ACCESS!


*** Sent via Developersdex http://www.developersdex.com ***

kentiler 05-03-2005 01:21 AM

Re: Better way than Label to use function to replace text in web page?
 
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!
> >



kentiler 05-03-2005 01:23 AM

Re: Better way than Label to use function to replace text in web page?
 
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


kentiler 05-03-2005 01:24 AM

Re: Better way than Label to use function to replace text in web page?
 
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


Brock Allen 05-03-2005 01:31 AM

Re: Better way than Label to use function to replace text in web page?
 
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!
>>>






All times are GMT. The time now is 06:49 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.