Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 555
  • Last Modified:

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

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
codefinger
Asked:
codefinger
  • 3
1 Solution
 
strickddCommented:
First make sure you aren't saving " " to the database.
0
 
codefingerAuthor Commented:
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
 
CodeCruiserCommented:
What's patreg? Where are you seeing the space code?
0
 
codefingerAuthor Commented:
Nevermind, found the solution.   Problem does not occur when I use String.Empty() instead of "".

0
 
codefingerAuthor Commented:
Problem does not occur when I use String.Empty() instead of "".
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now