DataBoundLiteralControl difficulties

G

Guest

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
 
G

Guest

in paragraph 5, it should read "...and i DON'T even see the characters"

similarly at the end of paragraph 6, ionvisible should read invisible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top