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

  • SEARCH
  • Home
  • 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 8740489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:08:21+00:00 2026-06-13T11:08:21+00:00

I have a viewstate and eventvalidation token that I am trying to pass in

  • 0

I have a viewstate and eventvalidation token that I am trying to pass in with my app.

The issue I am running into is that I am passing this info in:

string.Format("__EVENTTARGET=&__EVENTARGUMENT=&__LASTFOCUS=&__VIEWSTATE={0}&__EVENTVALIDATION={1}&{2}", viewstate, eventvalidation, request)

eventvalidation has a plus sign in it (+) which is causing a cat of the string, instead of displaying the literal character. Any ideas how I can prevent this from happening?

Here is my code to do the request:

WebRequest req = WebRequest.Create(url);
//Here Request is working properly; the EVENTVALIDATION token has the + sign in it.
byte[] send = Encoding.Default.GetBytes(request);
// I think after I convert it to byte[], it is doing something bad to the EVENTVALIDATION token.
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = send.Length;

Stream sout = req.GetRequestStream();
sout.Write(send, 0, send.Length);
sout.Flush();
sout.Close();

WebResponse res = req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
string returnvalue = sr.ReadToEnd();

return returnvalue;
  • 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-06-13T11:08:22+00:00Added an answer on June 13, 2026 at 11:08 am

    I used Uri.EscapeDataString and this did the trick!

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

Sidebar

Related Questions

I have read that viewstate is not there in asp.net MVC application. I am
I have a massive viewstate hidden field that is causing my application to be
I have a couple of pages that are bulky due to the viewstate. I
Scenario 1 (That Works) This is a POC i created. I have a script
I have read that the viewstate in asp.net stores the values of control properties
We have an asp.net webpage that uses viewstate. During a lengthy operation (that takes
Ok I have got ViewState[AddressID] and this ViewState[AddressID1] both storing AddressIDs ..Now if I
I read that one cannot use ASP.NET MVC with Server Control which have ViewState
A dumb question: Let's say I have an object that i store in viewstate.
suppose i have one static method and i need to access viewstate from that

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.