![]() |
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 |
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! > |
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 > |
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 *** |
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! > > |
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 |
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 |
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.