White-Space and DropDownList

G

Guest

I have data comming out of a stored procedure with embeded spaces. After
binding the data, it reomves ALL white-space except for 1 space. How can I
get the spaces to remain?
For example
This is what i want: (and if i view the source in IE it appears this way)
70001-8060 Water, Plant: Repairs-Pumps & Booster

This is what i get in the drop down:
70001-8060 Water, Plant: Repairs-Pumps & Booster

As you can tell the second method is ALOT harder on the eyes..
 
S

S. Justin Gengo

John,

The spaces have to be specially encoded to stay. Here's a function to do it:

Private Function Pad(ByVal server As Web.HttpServerUtility, ByVal
numberOfSpaces As Int32) As String
Try
Dim Spaces As String = ""
For items As Int32 = 1 To numberOfSpaces
Spaces &= " "
Next
Return server.HtmlDecode(Spaces)
Catch ex As Exception
Throw ex
End Try
End Function

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

Justin,
Thanks. That did the trick.

S. Justin Gengo said:
John,

The spaces have to be specially encoded to stay. Here's a function to do it:

Private Function Pad(ByVal server As Web.HttpServerUtility, ByVal
numberOfSpaces As Int32) As String
Try
Dim Spaces As String = ""
For items As Int32 = 1 To numberOfSpaces
Spaces &= " "
Next
Return server.HtmlDecode(Spaces)
Catch ex As Exception
Throw ex
End Try
End Function

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top