Discussion Locked

ASP.NET Question -- Please Help

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am using ASP.NET/VB.NET code to automatically populate a drop down control with information from a database using a stored procedure. However, when the drop down list populates itself, it includes HTML-specific tags that are hardcoded in the database tables. For example, the dropdown lists "CFO", rather than "CFO". Can anyone please offer some example code on how to strip/remove the HTML code so that it doesn't display in the drop down list? Thanks!

5 replies

by tuzib

Try using:Server.UrlEncode(QueriedStr)
note:QueriedStr is the string you get from your
database tables and then set QueriedStr in the dropdown lists,then the tags will not show in the dropdown lists.
If it works or not ,please rate it,Thank you!
Email:tuzib@163.com

by tuzib

If your server doesnt support HtmlDecode way then
Please email me to get the HtmlDecode way sourcecode (vb)!
And the way should be

by galahad04

Thanks very much for trying to help. Unfortunately, the posted code did not have the desired result for the drop down boxes. The HTML Encode/Decode seem to be dependent on the browser to be rendered correctly, and drop down boxes do notrecognize browser mark-up tags.

This discussion is closed to new replies.