Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

HtmlEncode bound data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 28 Apr 2008 11:25 GMT
Hi,

I have a gridview where I am hand binding the data.

In my view, I have a label. It has the text as   text='<%# Bind("MyField")
%>'

I have incoming data that may contain < and >. I need to HTML Encode this,
but I can't get it to work.

text='<%# Server.HtmlEncode(Bind("MyField")) %>'

I have tried changing the Bind to DataBinder.Eval(Container.DataItem,
"MyField") and wrapping the HtmlEncode around it, but it doesn't work.

What should I be doing?

Signature

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

David - 30 Apr 2008 09:15 GMT
I guess I have a problem and no easy solution...

Anybody? Even if just a thought to try and get it working?
Signature

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

> Hi,
>
[quoted text clipped - 12 lines]
>
> What should I be doing?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.