Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 23rd, 2004, 01:05 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default rich text / multi-language content


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 With Quote
  #2 (permalink)  
Old September 23rd, 2004, 02:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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 With Quote
  #3 (permalink)  
Old September 23rd, 2004, 03:32 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default

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 With Quote
  #4 (permalink)  
Old September 23rd, 2004, 03:58 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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 With Quote
  #5 (permalink)  
Old September 27th, 2004, 04:39 AM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default


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"
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Language Database nabeelalkaff BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 December 26th, 2007 02:41 AM
xslt multi language RoeZ XSLT 2 October 26th, 2007 06:50 AM
Multi-language website: almost there electricspace ASP.NET 2.0 Basics 0 July 28th, 2007 06:21 PM
Multi language scenario edgarw BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 May 7th, 2007 08:08 AM
Multi-language Lofa ASP.NET 1.0 and 1.1 Basics 2 October 25th, 2005 04:10 AM



All times are GMT -4. The time now is 12:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.