.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Get complete HttpWebResponse headers

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :.NET Framework


I've three kind of web response like bellow:

HTTP/1.1 302 Moved Temporarily
Date: Thu, 07 Oct 2010 07:57:15 GMT
Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/
X-Powered-By: PHP/5.2.9
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT
Location: setcookies.php?view=
Content-Length: 0
Keep-Alive: timeout=15, max=500
Connection: Keep-Alive
Content-Type: text/html

HTTP/1.1 302 Moved Temporarily
Date: Thu, 07 Oct 2010 07:57:17 GMT
Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/
X-Powered-By: PHP/5.2.9
Set-Cookie: c_sid=xxx; expires=Mon, 11-Oct-2010 11:57:17 GMT
Set-Cookie: c_sid2=xxx; expires=Mon, 11-Oct-2010 11:57:17 GMT
Set-Cookie: c_siduid=xxx; expires=Mon, 11-Oct-2010 11:57:17 GMT
Location: index.php?view=account
Content-Length: 0
Keep-Alive: timeout=15, max=499
Connection: Keep-Alive
Content-Type: text/html

HTTP/1.1 200 OK
Date: Thu, 07 Oct 2010 07:57:17 GMT
Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimi

View Complete Post

More Related Resource Links

Complete SQL Solution

SQL Server Solutions: SQL Server 2000/2005 Related Free Snippets.

Tooltip for GridView Column Headers (ASP.Net)

I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don't want to use javascript and wanted to use simple 'title' attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here's the code and logic behind it.

Scrollable GridView with fixed headers in asp.net C# vb.net

In this example i am going to show how to create scrollable GridView with fixed headers which don''t get scrolled with records and stay on the top in asp.net using css, I''ve tested this code on IE7 and Firefox 2.0 , 3.5.

For this we need to add css to headers of gridview to keep them on the top.

First of all place a Panel on the aspx page from thetoolbox. Set height to 200px and width to 200px
and scrollbars to Vertical.
Now add a gridview inside this Panel and set the datasource to populate gridview.

Parallel port complete: programming, interfacing & using the PC's parallel

Parallel port complete: programming, interfacing & using the PC's parallel


C++ Q&A: Locking Column Headers, Implementing Singleton Classes


Prevent the sizing of the column headers in an ATL composite control. Also, see how you can share a small amount of simple data among multiple processes running on the same machine without Remoting.

Paul DiLascia

MSDN Magazine June 2003

House of Web Services: Mandatory Headers in ASP.NET Web Services


The ASP.NET Web Services infrastructure includes support for programming with SOAP message headers. Unfortunately, the model for handling mandatory headers is flawed in that you need to write additional code so that a Web Service will not execute when a mandatory header is not processed. This column explores a specific problem that arises when you deal with mandatory SOAP handles and presents three solutions.

Tim Ewald

MSDN Magazine May 2003

Return a file with bad headers?


I've build a MP4Handler. The Mp4 hander selects a correct file from a url.
The system works if you work with 'normal' mp4 files.

But the problem is the MP4 files are genrated by another program, so i think there's the problem.
Right now i returned a test file, then it woks great!

Do i return the other file, i get a 412 error if i use it in IE (he shows a  400 error because i deleted the 412 error in the IIS i thought maybe that solves the problem) . In IE it doesn't work, but in firefox it works great!

In my Fiddler result, the first movie (guid url) is from firefox, and works great. The second with the text/html result (selected row) is from IIS.
How can i solve this problem?

Or is this the problem?:
This entity tag is not recognized by IIS. It only affects version 7.0 of the IIS software.
From: http://www.pc-library.com/errors/error-code/412-0x19C/ 


As coding i use this as base: http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx 
I changed The GetRequestedFileInfo with:
public override FileInfo GetRequeste

Cannot redirect HTTP headers already sent


I have been working on an registeration page for my web site in asp.net.After the person succesfully registers , another page is called which sends an email.After the email is sent it should redirect to the default page . I came accross this error when trying to redirect after sending the email.

"Cannot redirect HTTP headers already sent"

.What could the problem be?

Here is the code

//send email
MailMessage mail = new MailMessage();
mail.To =strName ;
mail.From = "GiftWorld@yahoo.com";
mail.BodyFormat = MailFormat.Text;
mail.Subject = "Thank you for registering -Gift World.com";
mail.Body = "Thank you for registering -Gift World.com";
SmtpMail.SmtpServer = "mara.strathmore.edu" ;

auto complete extender stops


Hello everyone

when the textbox of the  autocomplete extender looses focas the auto complete extender stops the returning any results or even firing events(onpopulating, onpupulated).

Could you please help me fix this.


and I there any way to know when the extender fires the request(please provide code example if you can).


thanks a lot.

space between two table headers


hi, here is the question. i have to display as follows:

Info 1                                               info 2

one                                                  one

two                                                  two

this is in my .ASPX file

here, i have info1 and info2 in <TH> tags. nw how do i get that space between those two.

rite now my out put is:

info1 info2

one                        one

two             &n

Convert .docx to web page - "the converter cannot complete the task because an internal error occurr


I'm trying to convert docx files to webpages to be published in to a library elsewhere on our sharepoint site. At first I was having no problem, the files were converting, however more recent files have returned the error: the converter cannot complete the task because an internal error occurred

I've tried writing, uploading and converting a simple docx file, and this works which has led me to believe that the problem is something in the docx files that i'm trying to convert. So i tried using word07 to clean the documents up by clicking Office button>prepare>inspect document then removing all the metadata, custom xml etc from the files resave, upload and convert, but still no joy.

I'd simply rewrite the document but the problem is that there are a lot of them.

Any ideas what's going wrong?


Workflow doesn't complete when a task is updated directly from an infopath form.

I have an approval workflow that creates a task for a group to approve or reject an InfoPath form. But if a member of the group opens the form and updates the task from there, it doesn't complete the workflow. It only completes the workflow if they go to the actual task and update it from there. Does anyone know how to fix that?

Add Expires headers to css, js


1. My question is how to add expiry header to css

 style.css which is my file

<%@ Page Language="C#" AutoEventWireup="true" ContentType="text/css" CodeBehind="Style.aspx.cs" Inherits="xxx.Style"%>
<%@ OutputCache Duration="1500" VaryByParam="none"%>
@import "<%= "style.css" %>";

 but this does not add expiry header to css


2. How do i add to infragistics css files


There are 16 static components without a far-future expiration date. 

* (no expires) http://xxx.com/LiveTest/ig_res/default/ig_shared.css
    * (no expires) http://xxx.com/LiveTest/ig_res/default/ig_panel.css
    * (no expires) http://xxx.com/LiveTest/ig_res/default/ig_texteditor.css
    * (no expires) http://xxx.com/LiveTest/ig_res/default/ig_monthcalendar.css
    * (2010/8

Populate Treeview upon entered criteria and page action without complete page posting on client side


1. I have a treeview on left side in a panel in my aspx page and I have a Text box and a Search button on the right panel. On entering a search criteria and clicking the Search button, I want to get the data needed for the treeview (FYI - I have a webservice call for that) and then populate the treeview completely but keep it collapsed to the root node.

  Each time I enter the search criteria and click the Search button, I don't want to post the entire page (and also don't like the page flicker), how can I achieve this? I know that in order to avoid complete postback upon Search button click, I can do so by client callback and get the data needed for the treeview, but in this case, I have to build the treeview nodes as table - row/cells and handle all the events and handlers myself, which I want to avoid (also means that I won't be able to take advantage of the inherent expand and collapse capabilities of the Treeview). On the other hand, if I use the OnTreeNodePopulate event handling of the Treeview control, using the C# script code on the aspx markup, it doesn't recognize the entered criteria in the Text box. So either way,

How to Add Custom SOAP Headers Into The Server Response Message in WSE3.0?

Hi Dear All, Assuming I am the service provider, may i know how many ways are there to insert a custom header into the server response message? So far I tried several ways, and it can be done in custom SoapFilters (by playing with SOAPEnvelope object), and SoapExtension (SOAPMessage object). Just wondering if this could be done at web service class by specifying a SOAPHeader attribute, just like adding a SOAPHeader into the SOAP request message at consumer side? If can, it might be much smarter than SoapFilter and SoapExtension.   Thanks in advance!   Best Regards, Charles

WCF client Java interop - No Response Headers = MessageSecurityEx

I am using a WCF client to communicate with a Websphere hosted web service.  The service requires my message to be signed, but not encrypted.  This is being done and works as expected.  I can see in my trace logs that I get a valid response back from the service.  However, it isn't making past the proxy becuase of the following error: System.ServiceModel.Security.MessageSecurityException: Security processor was un able to find a security header in the message. This might be because the message  is an unsecured fault or because there is a binding mismatch between the commun icating parties.   This can occur if the service is configured for security and the client is not using security. I've edited the binding to remove the timestamp and have verified that it is not being sent, however, I still get this error.   Here's what the header of my request looks like: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <s:Header> <ActivityId CorrelationId="b0d474df-8b00-4c30-bd05-d1e478529ce4" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">cb8e51de-83b4-4bfe-bf1c-fd92ce86f557</ActivityId> <o:Security s:mustUnderstand="1" xmlns:o="http://

ASP.NET caching headers not coming thru in IIS 6 (but are just fine in dev, which is XP's IIS 5.1

   I have some headers I am stuffing in an ASP.NET httphandler.. They work great in our XP dev environment (IIS 5.1) but on our clients prod boxes (IIS 6.0 running SSL) we aren't getting them.. Below is more detail. Offending Code: context.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));  context.Response.Cache.SetValidUntilExpires(false);  context.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);  context.Response.Cache.SetCacheability(HttpCacheability.NoCache);  context.Response.Cache.SetNoStore();   on our dev machines (sadly XP so IIS 5.1) the headers I get back are exactly what I want Server: Microsoft-IIS/5.1  Date: Fri, 27 Aug 2010 15:17:40 GMT  X-Powered-By: ASP.NET  X-AspNet-Version: 2.0.50727  Transfer-Encoding: chunked  Cache-Control: no-cache, no-store, must-revalidate  Pragma: no-cache  Expires: -1  Content-Type: application/xml; charset=utf-8    But when I take the same code and run it in production (IIS 6.0 and over SSL) the headers are not coming across correctly at all. Date Fri, 27 Aug 2010 14:59:02 GMT  Server Microsoft-IIS/6.0  mn 1c  X-Powered-By ASP.NET  X-AspNet-Version 2.0.50727  Transfer-Encoding chunked  Cache-Control private  Content-Type application/xml; charset=utf-8  Anyways ideas would be awesome Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend