Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am passing some data in Response headers like to an HTML page
C#
Response.Headers.Add("id","xxx");
Response.Redirect("../ab.html?");

So how can i get the data "id" from ab.html?

Can you please help me?
Posted
Updated 3-May-13 23:45pm
v3

1 solution

Sure you can do that by combining jQuery and AJAX.

First you need to make a AJAX call to that page using jQuery and then you can read the response headers.

i.e.
Make sure you are calling the correct URL

JavaScript
var resHeader;
resHeader = $.ajax({
  type: "GET",
  url: 'http://..../ab.html',
  success: function () {
    alert("id = "+ resHeader.getResponseHeader('id'));
  }
});


You can also get all the headers by calling: getAllResponseHeaders()

More details here: getResponseHeader[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900