johnnyg24 Posted October 31, 2012 Share Posted October 31, 2012 I have an ASP page that an outside company is requesting via AJAX. I've added "Access-Control-Allow-Origin", "*" to the response.addheader and everything works just fine. As soon as I add an <--#include file-->, the page does not work anymore. Can anyone tell me if this page structure is not allowed, or am I just doing something wrong? Thanks, Link to comment Share on other sites More sharing options...
justsomeguy Posted October 31, 2012 Share Posted October 31, 2012 Make sure you're setting all of the headers before including other files. Link to comment Share on other sites More sharing options...
johnnyg24 Posted October 31, 2012 Author Share Posted October 31, 2012 Thanks. I assume you are talking about setting the headers on both pages (the request page and the include page)? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 31, 2012 Share Posted October 31, 2012 You only need to set headers once, there is only one set of headers for a response. But if you include a file before setting the headers then something in that file may interfere with the headers getting set. It's better to set the headers before including a file that may cause a problem. Link to comment Share on other sites More sharing options...
johnnyg24 Posted October 31, 2012 Author Share Posted October 31, 2012 thanks, I was using the AddHeader twice. I since removed one of them and it works now. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now