Solved

Non-breaking space code inside "empty" text box.

Posted on 2011-09-15
5
523 Views
Last Modified: 2012-08-14
Both the clinic no and Address2 are null in the database:

This is how they are retrieved:

patreg.ClinicNo = IIf(IsDBNull(xdr("CLINIC_NO")), "", xdr("CLINIC_NO"))
patreg.Address2 = IIf(IsDBNull(xdr("ADDRESS2")), "", xdr("ADDRESS2"))

Open in new window


Then their values are assigned to textboxes on a web form:

For the Clinic_No, nothing is displayed in the textbox, which is correct.

However, for Address2, the html code for a non-breaking space is
displayed inside the text box!

What could I be doing wrong?
0
Comment
Question by:codefinger
  • 3
5 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 36545718
First make sure you aren't saving " " to the database.
0
 

Author Comment

by:codefinger
ID: 36546282
I did.  The database shows the value as null, so the problem seems to be occuring during/after retrieval, not during the save.

Good starting question, though.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36570526
What's patreg? Where are you seeing the space code?
0
 

Accepted Solution

by:
codefinger earned 0 total points
ID: 36571218
Nevermind, found the solution.   Problem does not occur when I use String.Empty() instead of "".

0
 

Author Closing Comment

by:codefinger
ID: 36594798
Problem does not occur when I use String.Empty() instead of "".
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now