Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Escape function within VB.net

Posted on 2014-01-07
5
Medium Priority
?
476 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 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

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…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline
Suggested Courses

927 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