Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
See more:
Hi,

my server is sending the "Connection" "keep-alive" header at the response. I must change it in some pages to response "connection" "close" but it does not seem to work.
Response.Headers.Add("Connection", "close"); does not affect the response nor does the line Response.Headers("Connection") = "close"

Thanks.
Posted
Updated 5-Jan-11 2:59am
v2
Comments
Sandesh M Patil 5-Jan-11 9:03am    
Are you dispose the connection.
Like connection.dispose()
Eli Nurman 5-Jan-11 9:06am    
How would i dispose the connection?
Sandesh M Patil 5-Jan-11 9:12am    
connection.dispose()
Eli Nurman 5-Jan-11 9:14am    
do you have that option on a asp.net page?

1 solution

Try:
MIDL
response.setHeader("Connection", "close");


In case, it does not work, check your IIS setting. Post the response code/edits that you are doing on server side.
 
Share this answer
 
Comments
Eli Nurman 5-Jan-11 10:28am    
response.setHeader is a java method. my project is ASP.NET
Sandeep Mewara 5-Jan-11 10:36am    
Ok. So, post where and what you are trying to change in response.

What does Response.End() send back?

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