Showing posts with label formatting. Show all posts
Showing posts with label formatting. Show all posts

Wednesday, March 28, 2012

Text Editing toolbar in asp.net 2.0

Hi..

Support & Guidence needed for developing text formatting Toolbar for asp.net form.

Generally it is seen in web mail -> compose mail side for changing font, size, color, Aligement, Paragraphs etc.

We also need help, How to store these data & call back with formatted values.

plz help.

http://xstandard.com/

Use the Lite version Text Editor its free...

Monday, March 26, 2012

text formatting?

I have an SQL database where I'm pulling up some long paragraph cells. I was wondering how I might be able to format the text within these cells... if this is possible. For instance, if there is a website, I would like to make it an active link…. or I might want to bold something and put in a button to do so.
I know this is probably very complicated but I was wondering if anyone knows where or what I should start reading to be able to do something like this? Any points or ideas would be greatly appreciated! Thanks in advance!
RayMaybe the easiest way would be to put tags into the text, and store the text as HTML within the server. Then, when you pull it out, just make sure you display it as HTML and not just text. This would mean that you would have to manually style the text and type all the tags before storing it into the server.

HTH

Jags
yeah thats what I've been doing right now, it works but I thought there might be a better way. Thanks.

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.

Thursday, March 22, 2012

textarea viewstate formatting

Hello.

What I am trying to do is implement a "preview" function that displays all of the html typed within a textarea onto a webpage with HTML intact. I am using the viewstate to preserve the contents of the textarea. However, I find that doing this replaces all "<" with "<", ">" with ">". As a result, the preview does not render any HTML.

It appears that viewstate with asp.net automatically converts the chars, perhaps as insurance to "sterilize" malicious script. Can someone confirm this?

Is there a way to prevent it from converting the carat characters for the viewState preservation? Or is it a fact of life that I'll need to manually convert them back?

Thanks,
walla118Thanks niceguy.

I just realized that HtmlDecode would work for my purposes. And your idea about using javascript to display preview might be a good way to go!

Thanks again.
Hi walla118,

Have you tried using:


HttpContext.Current.Server.HtmlEncode
HttpContext.Current.Server.HtmlDecode

These may help...?

I found that it is easier to open a pop-up using javascript for a "preview" rather than doing it server side...just a thought.

Hope this helps!

Jason

Text-based controls: Formatting as inline elements

I have had a question that I have been avoiding or using workarounds for for
a while. When using text-based controls (Labels, HyperLinks displayed as
text, LinkButtons, etc.), how do I format certain parts differently? For
example, I might have a set of instructions that I want keywords displayed
in a different color, or there might be a certain word that I want to
display as a link. When the text is all on the same line, I can simply place
the controls next to each other. But when the text will need to wrap to the
next line, this causes a problem. It is also rather tedious to use so many
controls just for a few links. Does anyone know of an efficient solution to
this problem? Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/How about using javascript to perform global replace on document.InnerHtml
at onload event? I've not tested it but I think it should work.

"Nathan Sokalski" <njsokalski@.hotmail.com> glsD:ut$GsMXvFHA.4032@.TK2MSFTNGP15.phx.g bl...
>I have had a question that I have been avoiding or using workarounds for
>for a while. When using text-based controls (Labels, HyperLinks displayed
>as text, LinkButtons, etc.), how do I format certain parts differently? For
>example, I might have a set of instructions that I want keywords displayed
>in a different color, or there might be a certain word that I want to
>display as a link. When the text is all on the same line, I can simply
>place the controls next to each other. But when the text will need to wrap
>to the next line, this causes a problem. It is also rather tedious to use
>so many controls just for a few links. Does anyone know of an efficient
>solution to this problem? Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/

Text-based controls: Formatting as inline elements

I have had a question that I have been avoiding or using workarounds for for
a while. When using text-based controls (Labels, HyperLinks displayed as
text, LinkButtons, etc.), how do I format certain parts differently? For
example, I might have a set of instructions that I want keywords displayed
in a different color, or there might be a certain word that I want to
display as a link. When the text is all on the same line, I can simply place
the controls next to each other. But when the text will need to wrap to the
next line, this causes a problem. It is also rather tedious to use so many
controls just for a few links. Does anyone know of an efficient solution to
this problem? Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/How about using javascript to perform global replace on document.InnerHtml
at onload event? I've not tested it but I think it should work.
"Nathan Sokalski" <njsokalski@.hotmail.com> glsD:ut$GsMXvFHA.4032@.TK2MSFTNGP15.phx
.gbl...
>I have had a question that I have been avoiding or using workarounds for
>for a while. When using text-based controls (Labels, HyperLinks displayed
>as text, LinkButtons, etc.), how do I format certain parts differently? For
>example, I might have a set of instructions that I want keywords displayed
>in a different color, or there might be a certain word that I want to
>display as a link. When the text is all on the same line, I can simply
>place the controls next to each other. But when the text will need to wrap
>to the next line, this causes a problem. It is also rather tedious to use
>so many controls just for a few links. Does anyone know of an efficient
>solution to this problem? Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>