Subject: rich text / multi-language content
Posted By: humour Post Date: 9/23/2004 1:05:45 PM

I am creating a website that I eventually want to scale to multiple languages.  I plan on storing strings representing different languages either in a resource-file, a database, or xml files.  Using a session variable I will determine the language preference of the user and the application will pull and display the text the user sees in the language of their choice.

I know I how to use server controls and the databind syntax but I want rich text content (perhaps I will store html formatted strings in my datastore to achieve this).  However I have some questions.

1) Is there a major disadvantage to dynamically create text for Search Engines?  Would I be better off creating 2 pages to get better search engine hits or is it irrelevant now?

2) I want my dynamic content to be rich text, not just plain text.  I dont think I can do this with the LABEL or the textbox or text controls.  Is there such a thing as a rich-text control? Can I somehow use a placeholder that marks a spot where a code-behind function will insert a string of formatted html.

3) Does anyone know of a rich text control that doesn't provide EDITING. I basically want a static rich text content control that I cn dynamically set via a code-behind page function.

Thx in Advance
Reply By: bmains Reply Date: 9/23/2004 2:29:07 PM
Hey,

No rich-text control for web, like you state.  You can use HTML formatted text in a label.  Make sure it is not Html encoded.  

As for the languages, Request.UserLanguages stores the language code too.

Brian
Reply By: humour Reply Date: 9/23/2004 3:32:15 PM
Brians said> "No rich-text control for web, like you state.  You can use HTML formatted text in a label.  Make sure it is not Html encoded."

But that is exactly what I want.... under asp I could dynamically decide where I want a spot of dynamic html.  I can do something like that in classic ASP, sure I can do something similar in dotnet.

See the diagram below...  Right at spot X is where I want to decide at runtime what I want to publish in that spot. It could be a simple paragraph, maybe its an html table.  Basically at spot x I want to output simple encoded html text stream.

/--------------------<body>

       x

</body>
\-------------/

Any ideas?
Reply By: bmains Reply Date: 9/23/2004 3:58:52 PM
Hey,

That's not rich-text; rich-text is more like the RichTextBox available in VB.NET windows forms, where you can color information and perform other more "flavorful" operations with it.

If you want to dynamically add text, you can do that, sure.

The best approach is to dynamically create the ASP.NET server controls in the code-behind (or in the script for in-line approach), and add them to a collection control, such as a panel.  Or if you want to do the HTML in a string, you could add the text to a literalcontrol, and add the literalcontrol to a collection, as such:

Panel1.Controls.Add(New LiteralControl("<b>test</b>"))

Brian
Reply By: humour Reply Date: 9/27/2004 4:39:20 AM

Thanks for the replies Brian. What I found that works well in addition to your suggestions is below... (I am not at work so the syntax is from memory).

' pseudocode...
htmlServerControl.innerHtml = "This is some <b>bolded</b> text"



Go to topic 19696

Return to index page 763
Return to index page 762
Return to index page 761
Return to index page 760
Return to index page 759
Return to index page 758
Return to index page 757
Return to index page 756
Return to index page 755
Return to index page 754