Solved

Server.HTMLEncode in a business object

Posted on 2007-04-06
4
421 Views
Last Modified: 2008-02-01
Is it possible to use Server.HTMLEncode in a business object, or does it always have to be called from a page?  If possible, what's the syntax?
0
Comment
Question by:codequest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:asp_lha
ID: 18869284
yes, you just need to add  referees to System.Web assembly

than you can use it as usual
0
 
LVL 2

Author Comment

by:codequest
ID: 18873029
Thanks for input.  I'm not exactly sure what you meant.

I'm parsing your comment as
"add  reference to System.Web"

I'm using VB, and   "Imports System.Web" doesn't seem to do it.   Any further suggestions?
0
 
LVL 5

Accepted Solution

by:
asp_lha earned 500 total points
ID: 18874037
sorry for my poor English

"Imports System.Web"  is not enough,
first ,right click the ‘Reference’ option under the project inside the solution explorer and select the ‘Add Reference…’ option.
It will show you a user interface screen where you browse for the target assembly.
Now you can select the System.Web assembly,  and then press OK.
0
 
LVL 2

Author Comment

by:codequest
ID: 18878145
Thanks for the input.   I found the "add reference" menu, and did that, and then, experimenting, I got it to work without adding the reference or even an "imports" like this.....

Imports Microsoft.VisualBasic

Public Class ServerHTMLEncodeTest
      Public Function MyHTMLEncode(ByVal varStr As String) As String
            Return System.Web.HttpUtility.HtmlEncode(varStr)
      End Function
End Class

Anyway, we got there.

Thanks!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

627 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