DataBoundLiteralControl difficulties

From: sbhmf (sbhmf_at_discussions.microsoft.com)
Date: 09/24/04


Date: Fri, 24 Sep 2004 10:47:08 -0700

when accessing the content of this object ( in this case a date/time string
whose length is 20 characters ), the browser displays the corresponding date
normally.

however, when the fiels is empty it does not display anything.

so what's the problem?

i am trying to implement a decision structure that will depend on the value
of the control: if it exist the do A, and if it is an empty string do B.

the problem is that the "empty string" is not at all empty, even though
nothing renders! in the course of debugging i found that the length of this
"empty string" is 49 characters long, and i even see the characters, and have
absolutely no idea what they are, how they got there, or what they are doing
there.

when a value is present (the regular 20-character date/time string), the
length of the text is 69 characters. there are obviously 49 characters that
are eluding me in any case, but i cannot create a dependable method based on
the length without being certain that it will always be constant, and in
doing that the first step is seeing the ionvisible characters.

how can i see them? why are they there? can ui strip them away? i tried to
trim them, but was unsuccessful.

the code:

Dim dblc As DataBoundLiteralControl, str As String
dblc = CType( e.Item.Cells(6).Controls(0),
System.Web.UI.DataBoundLiteralControl )
str = dblc.Text
lblFeedback.Text = "Length = " & str.Length & ", Value = " & str



Relevant Pages

  • Re: Prothon should not borrow Python strings!
    ... """It does not make sense to have a string without knowing what encoding ... same cul de sac as Python. ... Prothon_String_As_ASCII // raises error if there are high characters ... Python's split between byte strings and Unicode strings is ...
    (comp.lang.python)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... put them in stupid places. ... Programming is difficult (as you must surely appreciate, ... > strings will be in the range 1...1000 characters. ... impose an artificially small limit on string length." ...
    (comp.programming)
  • Re: Byte Array to String
    ... retrieved text will mismatch the original characters. ... encoding the characters. ... Dim strFileData as String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: A note on personal corruption as a result of using C
    ... impossible to write effective string validation routines by definition ... (Note that a string literal may contain embedded null characters; ... without resorting to abusive language. ... In practice, programmers typically use "struct" ...
    (comp.programming)
  • Re: Self-Documenting Code Contest
    ... self-documenting. ... query:= 'documenting' asSortedCollection. ... string size < query size ... two words becomes a set of Characters. ...
    (comp.lang.smalltalk)