Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6011357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:14:55+00:00 2026-05-23T02:14:55+00:00

I am from java basically. But i supposed to modify a c# application. This

  • 0

I am from java basically. But i supposed to modify a c# application. This application sends data of a text box to a server.(https connection)

everything is working fine.There is only one problem. If text in textbox is having “+” characters then on server side they are reaching as space. Means, if text box contains “amit+gupta” then on server side it is reaching as “amit gupta”.

*I afraid there might be some other combinations which may cause problem further.

Code

System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
StringBuilder postData = new StringBuilder();
postData.Append("data1="+textBox4.Text);
postData.Append("&data2="+textBox5.Text);
byte[] data = encoding.GetBytes(postData.ToString());

HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(serverUrl);
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;

Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);

My observation

As per my understanding, data should be url encoded first before sending to server. But…

UrlEncode is missing

Visual studio 2008 has been setup for developing windows applicaion. In this(I had tried on 3 different machines), I am not able to find UrlEncode(). I had explored System.Web too But 🙁

My questions;

  1. Whether there is something wrong with above code
  2. Whether UrlEncode() is available for web based project only
  3. Is there any alternate of UrlEncode(). So i can use it in my application
  4. Should i do some extra IDE settings or should i add some dll.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:14:55+00:00Added an answer on May 23, 2026 at 2:14 am

    You’re looking for HttpUtility.UrlEncode in System.Web.

    This requires adding a reference to System.Web.dll. If you can’t add a reference to that, make sure you have the complete profile (not the client profile). If you require the client profile, you will have to implement your own encoding function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java server application and a Flex client application. For my data
How would you invoke a client flash method from application server in java applicationadapter.
I am from Java Desktop Application background. May I know what is the best
Hey, I've tried researching how to POST data from java, and nothing seems to
I have to consume a .NET hosted web service from a Java application. Interoperability
This is straight from the Java Docs : This class and its iterator implement
I'm trying to make connection from flex to java and from java to mysql.
From Java, I'm extracting an executable into a location specified using File.createTempFile(). When I
From Java, is it possible to get the complete commandline with all arguments that
from my small knowlegde from java se i want to try a tutorial on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.