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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:04:19+00:00 2026-05-25T16:04:19+00:00

This is regarding forwarding POST variables properly in ASP.Net To force all connections use

  • 0

This is regarding forwarding POST variables properly in ASP.Net

To force all connections use the https protocol rather than http, I inserted the following code in Global.asax

If Not Request.IsSecureConnection Then
            Response.Redirect("https://" & Request.ServerVariables("HTTP_HOST") + Request.RawUrl)
End If

This was working fine until I encountered a form which is submitted using POST, and using the above method is breaking the form retrieval process.

Eg: the webpage is http://abc.com/page1.aspx (this page accepts only POST form data). now with forcing the application to redirect to https, the page is correctly getting redirected to https://abc.com/page1.aspx, however, all the form data is lost in the process.

Is there a way I can store and forward the Request.Form data??

  • 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-25T16:04:19+00:00Added an answer on May 25, 2026 at 4:04 pm

    That’s pretty much what the HTTP 307 status code is for. You may want to consider redirecting them with an HTTP 307 status instead of 302.

    An HTTP 307 means redirect, and re-submit POSTed data:

    In this occasion, the request should be repeated with another URI, but future requests can still use the original URI.[2] In contrast to 303, the request method should not be changed when reissuing the original request. For instance, a POST request must be repeated using another POST request
    Reference

    There is no super easy way to do it in ASP.NET, but it isn’t hard either. For example:

    Response.StatusCode = 307;
    Response.Status = "307 Temporary Redirect";
    Response.AddHeader("Location","http://www.new-url.com");
    

    Alternatively, you could use Server.Transfer(string) as well. Phil Haack gives an explanation of that here. That may be a simpler option for you.

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

Sidebar

Related Questions

This is regarding ASP.NET MVC. Let's say I have a web site that is
I've run in to a this problem regarding Sessions in asp.net. I'm creating an
(this is regarding the Ramaze.net framework) I ran into some really strange problems while
Regarding this post and this other one . Suppose I have the following: public
Regarding this post about email verification, using C#, how would you issue a VRFY
MSDN is rather vague regarding this attribute. The custom data string can be set
There is plenty of discussion for this regarding https. But do the headers get
This is regarding an automation I need to use GEF in RCP application. In
This is regarding use of annotations in Java. I associated an annotation with a
I couldn't find anything regarding this on http://msdn.microsoft.com/en-us/library/bb982727.aspx . Maybe I could use '[^]+'

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.