POST parameters in ASP.NET

I want to redirect to another ASP.NET (C#) page and at the same time, pass POST parameters to it.
On the second page, I want to retrieve these parameters.

If possible, please provide some sample code. Thanks!
Who is Participating?

Improve company productivity with a Business Account.Sign Up

nishant joshiConnect With a Mentor Technology Development ConsultantCommented:

there is a problem with link tag in EE.
nishant joshiTechnology Development ConsultantCommented:
dshrenikAuthor Commented:
The link is broken.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

dshrenikAuthor Commented:
I want to do it this way:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);

I am not sure how I can POST parameters, and also redirect to the url. The webpage represented by "url" must then retrieve the POST parameters.
nishant joshiTechnology Development ConsultantCommented:
ExpertLogin_890Connect With a Mentor Commented:
you can pass the post parameter by using the form collection with Request object add the hidden fields for parameter those you want to pass through the pages those you dont want to view by others
your form having fields like

ID: <input name="ID">
 Name : <input name="name">
Addres:  <input name="address">

and submit the form using form.submit method using post method
you can retrieves the values in code behing page


or in htmlcode file


gopaltaydeConnect With a Mentor Commented:
here is the link for cross page postback
Manoj PatilConnect With a Mentor Sr. Software EngineerCommented:
you can try with following code

void Page_Load(object sender, EventArgs e)
    System.Text.StringBuilder displayValues = 
        new System.Text.StringBuilder();
        postedValues = Request.Form;
    String nextKey;
    for(int i = 0; i < postedValues.AllKeys.Length; i++)
        nextKey = postedValues.AllKeys[i];
        if(nextKey.Substring(0, 2) != "__")
            displayValues.Append(" = ");
   Label1.Text = displayValues.ToString();

Open in new window

For more ways check following link
dshrenikAuthor Commented:
The problem is that I need to construct the POST parameters with C# code. They're not values of form elements.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.