Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

details view update problem

Status
Not open for further replies.

jjme88

Programmer
Dec 28, 2007
58
GB
HI All,

i have a curious problem I cant work out. i have a details view control bound to a SQL2000 table on my asp.net web page. I have one particular filed that is causing me a problem when trying to update the field. the field is a text box bound to a varchar(1000) field in the database.

if i enter the text abc123 into this field on the control and hit update all is well but if i enter;
<abc123 into this field then i get an error;

XML Parsing Error: no element found
Location: Line Number 1, Column 1:

the trouble is I will need to enter this '<' charter into the field as it will contain an html fragment to create a link.

anyone got any ideas what the problem is. Its as though '<' is an invalid charter, but I already know SQL can store such a charter no problem.
 
you have to encode the content first
ex.
dim s as string
s = Server.HTMLEncode(yourtextbox.text)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top