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 323071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:59:50+00:00 2026-05-12T08:59:50+00:00

This is using ASP.NET 2.0 in an IIS 6 world. I have a user

  • 0

This is using ASP.NET 2.0 in an IIS 6 world.

I have a user submitting a form that sends the data to be via POST. The page receiving the data does some simple validations. If validation passes, then a black-box code routine runs that basically reads the data using Request.Form(“NameHere”).

I’d like to be able to change the value of the POST item and then put it back on the POST. I don’t have the ability to modify the code that reads the Request.Form(“NameHere”), so my work around idea is to modify the data during the page’s load event. If I change the value of the POST item, then the black-box code doesn’t have to be modified.

Is it possible to change the value of an item on the HTTP POST?

Has anyone done this?

Thanks!

  • 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-12T08:59:50+00:00Added an answer on May 12, 2026 at 8:59 am

    Even though it is a bit hacky, there is a way to change the value of a POST variable.

    We can use Reflection to mark the Request.Form collection as non-readonly, change the value to what we want and mark it back as readonly again (so that other people cannot change values). Use the following function:

    protected void SetFormValue(string key, string value)
    {
      var collection = HttpContext.Current.Request.Form;
    
      // Get the "IsReadOnly" protected instance property.
      var propInfo = collection.GetType().GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);
    
      // Mark the collection as NOT "IsReadOnly"
      propInfo.SetValue(collection, false, new object[] { });
    
      // Change the value of the key.
      collection[key] = value;
    
      // Mark the collection back as "IsReadOnly"     
      propInfo.SetValue(collection, true, new object[] { });
    }
    

    I have tested the code on my machine and it works fine. However, I cannot give any performance or portability guarantees.

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

Sidebar

Ask A Question

Stats

  • Questions 273k
  • Answers 273k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Every node also has a Nodes property. Use a recursive… May 13, 2026 at 2:09 pm
  • Editorial Team
    Editorial Team added an answer There is a nice implementation of an Android app (irb… May 13, 2026 at 2:09 pm
  • Editorial Team
    Editorial Team added an answer I want to use a algorithm to reduce memory used… May 13, 2026 at 2:09 pm

Related Questions

Occasionally I have a problem when I attempt to update a web reference in
My company develops and sells a SaaS application that has hundreds of customers. Some
What is the best way to write minimal error logs in an ASP.NET 2.0
I am using asp.net 2.0 and IIS 7 on vista 64 bit. everytime, when

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.