add header using c++

Add-in Express™ Support Service
That's what is more important than anything else

add header using c++
 
pa1 modi




Posts: 84
Joined: 2011-06-18
hi sergey,

as you told "add the new header again so that you can get it in the Response object of your add-on."

but i am not able to get header through response object using this code:


WebHeaderCollection^ header = response->Headers;
for (int i = 0; i < header->Count; i++)
{
MessageBox::Show("{0}"+header->GetKey(i)+"{1}"+header[i]);
}
Posted 20 Sep, 2011 06:36:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Right, the server did not modify your response. To modify the response you need to use the code in the Page_Load event handler published here:
http://www.add-in-express.com/forum/read.php?PAGEN_1=2&FID=10&TID=9744#nav_start
Posted 20 Sep, 2011 07:10:43 Top
pa1 modi




Posts: 84
Joined: 2011-06-18
you mean this:


protected void Page_Load(object sender, EventArgs e)
{
if (this.Request.Headers.Count > 0)
{
string value = this.Request.Headers["MyCustomHeaderValue"];
if (!String.IsNullOrEmpty(value))
{
if (value.Equals("test"))
this.Response.AddHeader("MyResponseHeaderValue", "Request processed successfully.");
}
}
}

can you plz provide it in c++..
Posted 20 Sep, 2011 07:44:22 Top
pa1 modi




Posts: 84
Joined: 2011-06-18
we have not this "protected void Page_Load(object sender, EventArgs e)" event

we have this events:
1.private: System::Void MyIEToolbar1_Load(System::Object^ sender, System::EventArgs^ e)
2.private: System::Void adxiehtmlDocEvents1_OnLoad(System::Object^ sender, System::Object^ eventObject)

is that pageLoad code work in above one..?
Posted 20 Sep, 2011 08:02:28 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
ASP.NET doesn't support C++.
Posted 20 Sep, 2011 08:03:54 Top