CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 10/25/2004 1:26:25 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 61 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
imre_b
Asp.Net User
Literal content problem10/25/2004 1:26:25 PM

0/0

I build a fine working translating user control. It's translating phrases and words depending on a xml source.

Nederlands.xml : (simplefied)

<?xml version="1.0" encoding="utf-8" ?>
<translation>

<words>
<this>dit</this>
<please>S.V.P.</please>
<webpage>webpagina</webpage>
<ready>klaar</ready>
<is>is</is>
<click_here>klik hier</click_here>
<to_go_further>om verder te gaan</to_go_further>
</words>
</translation>

Translator.ascx :

<%@ Control Language="VB" AutoEventWireup="false" CompileWith="translator.ascx.vb" ClassName="translator_ascx" %>
<asp:label id="translated" runat="server" />

Translator.ascx.vb :

Imports System
Imports System.data

Public Class translator_ascx

Dim lang, word As String
Dim stringArray As String()
Dim tel As Integer

Public Property Langfile() As String

Get
Return translated.Text
End Get
Set(ByVal value As String)
lang = value
End Set
End Property
Public Property Phrase() As String
Get
Return translated.Text
End Get
Set(ByVal value As String)
Dim langaugefiletoread As DataSet = New DataSet
stringArray = value.Split(" ")
For tel = 0 To stringArray.Length - 1
Try
langaugefiletoread.ReadXml(MapPath(lang))
word = langaugefiletoread.Tables("words").Rows(0).Item(stringArray(tel)).ToString()
If Asc(Left(stringArray(tel), 1)) > 64 And Asc(Left(stringArray(tel), 1)) < 91 Then
translated.Text += UCase(Left(word, 1)) & LCase(Right(word, Len(word) - 1)) & " "
Else
translated.Text += word & " "
End If
Catch
translated.Text += stringArray(tel) & " "
End Try
Next
End Set
End Property
End Class

default.aspx :

<%@ Page Language="VB" AutoEventWireup="false" CompileWith="Default.aspx.vb" ClassName="Default_aspx" Debug="true" %>
<%@ Register TagPrefix="otd" TagName="translator" Src="otd/translator.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Otd test page</title>
</head>
<body>
<form id="form1" runat="server">

<otd:translator Phrase="<a href='http://go.com'> Click_here </a>" langfile="Nederlands.xml" runat="server" /><br />

</form>
</body>
</html>

------------------------------------

This all works very fine, but de control tag is not well formed, i would like to see this:

<otd:translator langfile="Nederlands.xml" runat="server" />

<a href='http://go.com'> Click_here </a>"

</otd:translator>

-----------------------------------

But i can't get rid of the error "No literal content allowed".
Anyone a good suggestion?
Thanks in front.

imre


imre_b
Asp.Net User
Re: No error now, also no solution10/26/2004 6:16:55 AM

0/0


By changing the class like this :

<ParseChildren(False), PersistChildren(True)> Public Class translator_ascx

End class

The errors stopped, i tried to understand these commands: (ParseChildren and PersistChildren), can anyone tell me?
And how to convert the literal content to a useable string?

Thanks anyway,

imre




<otd:translator id="translator1" phrase="Click_here" langfile="Nederlands.xml" runat="server" >
literal content
</otd:translator>

imre_b
Asp.Net User
Re: problem solved...10/26/2004 8:54:29 AM

0/0

Imports System
Imports System.data
Imports System.IO

<ParseChildren(False), PersistChildren(False)> Public Class translator_ascx

Dim lang, word As String
Dim stringArray As String()
Dim tel As Integer

'get the langfile (filename.xml) property
Public Property Langfile() As String
Get
Return translated.Text
End Get
Set(ByVal value As String)
lang = value
End Set
End Property

'retrieve literal content (to a string)

Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

'*** Render the page and retrieve into StringBuilder
Dim sb As New StringBuilder()
Dim hWriter As New HtmlTextWriter(New StringWriter(sb))

MyBase.Render(hWriter)
' *** store to a string
Dim PageResult As String = sb.ToString()

'translating routine
Dim langaugefiletoread As DataSet = New DataSet
stringArray = PageResult.Split(" ")
For tel = 0 To stringArray.Length - 1
Try
langaugefiletoread.ReadXml(MapPath(lang))
word = langaugefiletoread.Tables("words").Rows(0).Item(stringArray(tel)).ToString()
If Asc(Left(stringArray(tel), 1)) > 64 And Asc(Left(stringArray(tel), 1)) < 91 Then
translated.Text += UCase(Left(word, 1)) & LCase(Right(word, Len(word) - 1)) & " "
Else
translated.Text += word & " "
End If
Catch
translated.Text += stringArray(tel) & " "
End Try
Next

' *** Write it back to the server
writer.Write(translated.Text)

End Sub

End Class
bmains
Asp.Net User
Re: Literal content problem10/26/2004 4:52:44 PM

0/0

Hey,

Something that I did similar to that (kind of) can be found here: http://www.dotnetjohn.com/articles.aspx?articleid=164.

HTH,

Brian
Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Literal Meaning Authors: François Récanati, Pages: 179, Published: 2004
Danish Yearbook of Philosophy Authors: Martin Zerlang, Pages: 200, Published: 1997
Cognitive Psychology and Information Processing: An Introduction: An Introduction Authors: Janet Lachman, Earl C. Butterfield, Pages: 592, Published: 1979
Knowledge, Evolution, and Paradox: The Ontology of Language Authors: Koen DePryck, Pages: 184, Published: 1993
Acceptance and Commitment Therapy: An Experiential Approach to Behavior Change Authors: Steven C. Hayes, Kirk D. Strosahl, Kelly G. Wilson, Pages: 304, Published: 2003
The Poetics of the Common Knowledge Authors: Don Byrd, Pages: 404, Published: 1994
Searching: The Theory and Practice of Making Cultural Change Authors: Merrelyn Emery, Pages: 258, Published: 1999
Case Study Research: Design and Methods Authors: Robert K. Yin, Pages: 181, Published: 2003
Aesthetics and Politics: the key texts of the classic debate within german marxism Authors: Ernst Bloch, Ronald Taylor, Pages: 220, Published: 1980

Web:
Literal content is not allowed within a control - ASP.NET Forums Literal content ('some one') is not allowed within a webcontrols MailLink. What shoul I do to fix that problem? Bellow is the source code for this control: ...
Weird error - Literal content is not allowed within a 'skin file' Jan 26, 2006 ... Talk about Weird error - Literal content is not allowed within a 'skin file'
[Mono-list] Asp.net error loading page Literal content not allowed ... Apr 23, 2004 ... [Mono-list] Asp.net error loading page Literal content not allowed . ... Any help pls :) Literal content not allowed for = System.Web.UI. ...
Weird error - Literal content is not allowed within a 'skin file' and have run into a weird problem trying to add a skin file. ... Literal content ('ERROR: Literal content ('How can I put Literal content into a User Control? - ng.asp-net ... Weird error - Literal content is not allowed within a 'skin file' Literal ... a 'skin file' and have run into a weird problem trying to add a skin file. ...
Re: Returning Complex Document / Literal Content: msg#00003 php ... Subject: [Nusoap-general] Returning Complex Document / Literal Content > Hello, ... The problem is that the serializeRPCParameters method (and ...
Nabble - Mono - ASP.NET (readonly) - Literal content not allowed Literal content not allowed. Hello, i've installed mono2 and xsp2 on my apache2. Now i'd like to use my old IIS Page on apache. If I try the site, ...
Custom Web Control - Enable literal content "Parser Error Message: Literal content ('test') is not allowed within a ... Problem Deleting entries from windows event log using DeleteEvent. ...
Adding literal content to webcontrol via editor - ASP.NET Building ... Adding literal content to webcontrol via editor ASP. ... Problem is, the editor should be attached to a specific property (using the Editor ...

Videos:
The Beatles - P.S. I Love You The Beatles - P.S. I Love You High Quality: http://www.youtube.com/watch?v=ow355d7Ubkw&feature=email&fmt=18 Copyright - 1963 EMI Records ...
Asian Idol, Singapore Idol 2, Hady Mirza Sings on Ria. First, the Ria radio DJs sing and play guitar. They are then joined by Hady, Singapore Idol 2. Now crowned as 1st Asian Idol. translation by ...
To solve my problems, I must look into the past and present ... This is my first non-Mugen video. It took me around 3-4 hours to make in WMM(I should use something else though). I attempt to explain how the ...
Threats and insults by the Gaeta Ibarra family against Rob ... The extreme obstinacy in errors and abusive behaviors of the Gaeta Ibarra family is astonishing. And one of the proofs of it is this video ...
ATR - Spirit Digivolving Beetlemon Figure Review The next thrilling Digimon review! A little note on aspect ratios... I think I'll do a vid on that. But, at the end, notice how there are ...
Requiem of Genesis A video outlining the scientific blunders in the literal context of Genesis. Obviously, the video is aimed primarily at YEC's who take a literal ...
Sean Landers New Paintings at ANDREA ROSEN Gallery James Kalm views Sean Landers new paintings. These text based pictures create a visual analogy of language's warps and mutations when it is ...
REAL info on 2012 and Planet X ( Nibiru ) - 4 of 5 The content is science fiction. Do not take the narrator to literal. This is for entertainment only. Part 4 of 5 examines the massive Planet ...
The Private Life of Plants (Part 6-6) - Surviving Legendado PT-BR, Subtitles ENG Send subtitles to brauliobo at gmail dot com 6. "Surviving" Broadcast 9 February 1995, the final episode ...
Arino Mamade Lovin'U - Zoids Genesis ED2 The second Zoids Genesis Ending Theme, 'Arino Mamade Lovin'U', sung by Re Mii and Kotona's voice actresses, Kimiko Koyama and Shizuka Ito.




Search This Site:










free asp.net hosting???

application install like on windows update

regular expression editor

multiple composite controls on a page and event firing unexpectedly

any asp.net shared web hosting that supports ffmpeg video streaming software?

building my own licensce key

disappering child controls and content.

repeater question

render problem???

custom tag parser

designer attribute problem

license clause clarification: commercial software hosting service.

creating usercontrol

support validation

question about a shared host and limitations on scripting

event doesn't fire in user control.

windows 2003 service pack 1 problems ?

why does bubbling events use virtual functions?

building a data-bound templated control

search and suggest open samaccountname when creating users

custom control attributes in property box

enable design time support for custom control in repeater

looking for a good tutorial

when this code should be executed

anyone written their own menu control in vb.net ?

no admin tool? i need help

databound controls

problem with compositedataboundcontrol and getsampledatasource

reseller hosting and members providers

.net 2.0 : smart tags and readonly collection property

  Privacy | Contact Us
All Times Are GMT