Solved

Escape function within VB.net

Posted on 2014-01-07
5
379 Views
Last Modified: 2014-01-08
Does a javascript Escape equivalent function exist in vb.net which allows me to post a form that contains specials characters?
0
Comment
Question by:TheChos
  • 3
5 Comments
 
LVL 22

Accepted Solution

by:
Ivo Stoykov earned 500 total points
ID: 39764434
What about HttpServerUtility.UrlEncode? (There are samples in documentation)

HTH

Ivo Stoykov
0
 
LVL 40
ID: 39764470
VB does not use any type of escape character.

If you mean a Windows Form, there is no need for them anyway. Windows uses Unicode characters, so you can display anything you want.

You just have to select a font that has the characters you need.

In order to explore the characters available in a specific font and copy them to the clipboard in order to be able to paste them in your application, use the Character Map application that is provided with Windows. Simply call charmap in a command prompt.
0
 

Author Comment

by:TheChos
ID: 39764713
I seem to be missing something and I'm sure it's an easy fix.  Below is what I have but receive errors with both attempts at the HttpServerUtility.UrlEncode answer.

Sample 1)
        Imports System.web

        Dim webClient As New System.Net.WebClient()
        Dim strDownload As String

        strDownload = "http://www.mystie.com/mypage.asp" _
            & "?ClientID=" & Trim(txtClientID.Text) _
            & "&CesNotes=" & Server.UrlEncode(txtNotes.Text)
        Dim content As String = webClient.DownloadString(strDownload)

Sample 2)
        Imports System.web

       Dim webClient As New System.Net.WebClient()
        Dim strDownload As String

        strDownload = "http://www.mystie.com/mypage.asp" _
            & "?ClientID=" & Trim(txtClientID.Text) _
            & "&CesNotes=" & HttpContext.Current.Server.UrlEncode(txtNotes.Text)
        Dim content As String = webClient.DownloadString(strDownload)
0
 

Author Comment

by:TheChos
ID: 39766510
I've requested that this question be closed as follows:

Accepted answer: 0 points for TheChos's comment #a39764713

for the following reason:

Worked once I added the reference.  Thanks.
0
 

Author Closing Comment

by:TheChos
ID: 39766511
Worked once I added the reference.  thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

947 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now