Showing posts with label alignment. Show all posts
Showing posts with label alignment. Show all posts

Monday, March 26, 2012

text formatting problem

hi guys,
I realized that whenever the text content of a database is loaded, its formatting (like paragraphing and alignment) is lost! How can I preserve these formattings?

cheersassign the output of the field into a variable (like: strFieldResults)

then, do a replace function on the contents:

strFieldResults=strFieldResults.Replace(vbcrlf, "<br>")

Each line feed separation is stored as a 'vbcrlf' -- - the browser doesn't understand that, so you need to replace these with the HTML LINE BREAK tag, so the browser will understand them.
ic...thx
hi augustwind,
I've tried the code you've given me but it doesn't seems to work. Instead of giving me a line break, it simply inserts a space in between the paragraphs. Do u have any working example of the code which i can reference to?
Use a Css Style sheet and set all your objects to the style you want.

like

.button{background-color: #000099; }

and then in your webform set button1's cssclass to button.

hope that helps
~
hi sausykat,
think you've misunderstood my question. My problem is that whenever the content from my database is loaded, the text's formatting is always lost. So I was asking how can I retain those formattings.

But however, you brought out an interesting point about using the css style sheet to customise the object's style--something which I didn't know how to use either.
So may I ask you where can I learn more about using css style sheet? Do you have a good tutorial for it or something?

Thanks for your help.
Most of what i've learned so far on style sheets are from the MSDN library and different forums i've jumped on.

Tuesday, March 13, 2012

textbox Alignment

<asp:Textbox id="Textbox1" style="TEXT-ALIGN: right" runat="server" Text="
Text1 "></asp:Textbox>
<asp:Textbox id="Textbox2" style="TEXT-ALIGN: center" runat="server" Text="
Text2 "></asp:Textbox>
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espa?ol
Ven, y hablemos de ASP.NET...
======================
"JIM.H." <JIMH@dotnet.itags.org.discussions.microsoft.com> wrote in message news:50F96708-B0EE-42FC-9837-81B
858D542A5@dotnet.itags.org.microsoft.com...
> how do you do Alignment in a textbox?is it possible to set this in properties window?
"Juan T. Llibre" wrote:
> <asp:Textbox id="Textbox1" style="TEXT-ALIGN: right" runat="server" Text="
Text1 "></asp:Textbox>
> <asp:Textbox id="Textbox2" style="TEXT-ALIGN: center" runat="server" Text=
" Text2 "></asp:Textbox>
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espa?ol
> Ven, y hablemos de ASP.NET...
> ======================
> "JIM.H." <JIMH@.discussions.microsoft.com> wrote in message news:50F96708-B
0EE-42FC-9837-81B858D542A5@.microsoft.com...
You *could* create a CSS stylesheet, and set it there.
The stylesheet would be available in the IDE,
via the CssClass property.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:95F0D629-1558-42FB-BD97-1F5FA1A178A6@.microsoft.com...
> is it possible to set this in properties window?
> "Juan T. Llibre" wrote:
>