Solved

Escape function within VB.net

Posted on 2014-01-07
5
373 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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)…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

19 Experts available now in Live!

Get 1:1 Help Now