.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

How to read the custom http header

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net


I have just joined the forum. I have a very simple query. I have added custom header to my website. Now I want to read the custom header. I am using IIS 6.0 on windows XP. I have already tried using using the Request.ServerVariables and and Request.header method. But none of them give me the custom header added to website.

Can any body help?

Thanks a lot in advance



View Complete Post

More Related Resource Links

read http custom header from web service


cant read http custome header "MSISDN" from my web service ... same code works on regular asp.net page. Can anyone shade a light on that subject ?

I am not able to read xml file with XDocument if its Descendants has Attribute xmlns="http://abc.co


I am not able to read xml file with XDocument if its Descendants has  Attribute like:-

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <row ID="1" xmlns="http://www.opentravela.org/OTA/2003/05">
    <var country_name="Caribbean and Rest of the world" city_name="Kingston" flight_category="Economy Class" via="Atlanta" flight_departure="London Heathrow" airline_logo="Delta" adult_fare="Delta" child_fare="660" infant_fare="561" date1="132" date2="2010-08-15" />


I don't know what to do ?

Looking for some help..

Custom Grid View Header - Grid view Row Created event vs Gridview row databound events ?


Hi Gurus ,

It happened to add an extra Gridveiw Header in row_databound event , It did worked fine on !Postback but disappered on Page.Postback . Quick google search guided me to move the event to Row_Created event and every thing is okay .

Can any expert post some pointers , differnces between grid row_created vs row_databount with some sample table data created dynamically  behaviour of both the events in !Postback and page.Postback .

Thanks a tonne in Advance and  any inputs will be valued and appreciated .

How to pass values using http header to another domain?

Hi,There are two applications "Sender", "Receiver"."Receiver" is a asp.net page, running in a server"Sender" is not an asp.net page and running in some other server."Sender" is passing a string (eg. userName) through http header."Receiver" is reading the string from http header as follows        Request.Header["userName"].How to pass values through http header? Can I have some samples?Thanks,Ashokan

how to read a custom dynamic data meta data attribute in a field template

All --Please help.I need to know how to read a custom dynamic data meta data attribute in a field template.I know how to do it in a page template because I have a handle to the meta table on the page.However, I do not know how to get a handle to the meta column at run time in a field template.Can you help?Please advise.Thank you.-- Mark Kamoski

Server cannot append header after HTTP headers have been sent

Can some one please help me with this issue- I am writing exceptions to event log, and my event log is filled with this exception messageSystem.Web.HttpException: Server cannot append header after HTTP headers have been sent.    at System.Web.HttpResponse.AppendHeader(String name, String value)    at System.Web.HttpResponse.AddHeader(String name, String value)    at AddFormPopUp.streamingFiles(String DocID, String FilePath, String FileExtension1)  Here is the code in streamingFiles function.Response.Clear() Dim binReader As New BinaryReader(File.Open((strFileNamePath), FileMode.Open, FileAccess.Read)) binReader.BaseStream.Position = 0 Dim binFile As Byte() binFile = binReader.ReadBytes(Convert.ToInt32(binReader.BaseStream.Length)) binReader.Close() Dim fileStream As New FileStream(strFileNamePath, FileMode.Open, FileAccess.Read) fileStream.Read(binFile, 0, fileStream.Length) Response.AddHeader("content-disposition", "attachment; filename=" & Strfilenameonly) Response.OutputStream.Write(binFile, 0, binFile.Length) fileStream.Close() If Response.IsClientConnected Then Response.Flush() binFile = Nothing Response.Clear() response.end  

How to read excel header name and put into SELECT statement?

Hi,        I'm trying to read Excel file header column name. Then I can query data from excel using SELECT statement. For instance. column name is name, department and email.  Then I want this three header name being detected using code and put in select statement. User no need to care about the header name and we can use code to read the header name instead of hardcode header name inside SELECT statement.       Please provide the details. Thanks.

Programmatically remove IIS HTTP header settings

 Our IIS server (v7) has the following settings in [Custom HTTP Headers] for our whole site: Pragma: no-cacheCache-Control: private, no-cache, no-store, max-age=0, must-revalidate, post-check=0, pre-check=0X-Powered-By: ASP.NET Out of the whole site, there are some pages that require the "no cache" setting to be removed for them to work properly. This was done manually by our IIS Administrator until recently.  Now we were told that we need to do it programmatically on our end. The following were the code snippets (VB.NET) we have used with no luck in success. Advice is appreciated, Thanks! Method-1Response.Headers.Remove("Pragma")Response.Headers.Remove("Cache-Control")Response.Headers.Add("Cache-Control", "private")Response.CacheControl = System.Web.HttpCacheability.public Method-2Response.ClearHeaders()Response.Headers.Clear()Response.CacheControl = "Public"Response.Cache.SetCacheability(HttpCacheability.Public)Response.Cache.SetAllowResponseInBrowserHistory(True)

How to Set Up Remote Desktop with Windows Mobile 6.1 Read more: http://www.brighthub.com/mobile/win

Most Windows Mobile 6.1 devices come with RDP (Remote Desktop Protocol) as an optional component - one that allows the user of the device to interact with a remote PC running Windows XP (or Vista), whether it's situated in the home or office.
Setup on your PC First

It's a topic that is surrounded by mystery, due to a combination of secrecy and apathy - yet Remote Desktop Mobile on Windows Mobile 6.1 is surprisingly easy to set up, with great results.

Remote working via your Windows Mobile 6.1 device is likely to be something that happens rarely - such as when you need to urgently retrieve a file, for instance. Whatever the reason Remote Desktop needs to be enabled on your Windows desktop PC before you can continue.

Read more: http://www.brighthub.com/mobile/windows-mobile-platform/articles/26932.aspx#ixzz0zU2Gf1Kr

Custom Control - Read Only Properties List

How would I add a (dropdown)  list of available values for a custom server control property?(Just like 'Visible' property of most controls has valid values of 'True/False' and nothing else can be entered or selected)

write Custom MemberShip provdider only to read the connection string from other file

hi,    In asp.net mvc project I am using MYSQlMemberShipProvider. Now I want that instead of reading the connection string from web.config file, it will read the connection string from external file every time. So that I am implementing the cutsom mebership provider class, this class inherits the MemberShipProvider class.    But the problem is that if I inherits the MemberShipProvider class then I have to impelment all of its method in my cutsom membership provider class, But I want to use all other inbuilt methods of MemeberShip. What can i do.I only want to add the code like below: public class CustomSqlMembershipProvider :MembershipProvider    {        public override void Initialize(string name, NameValueCollection configs)        {            base.Initialize(name, configs);                Connectionstring objProducts = // redaing the connection string.   }}But on compiltaion it is giving me the error does not implement inherit abstract member. Please Suggest me any idea.        Thanks In AdanaceAayushi

WSE 2.0 and/or WCF - how to set wsa:Action in soap:Header different from HTTP header SoapAction?


I currently have a WSE 2.0 WebServicesClientProtocol object (generated from WSDL) created which has a a valid uri as its soapAction (from the WSDL binding). I need to set the <wsa:Action> value in the <soap:Header> to something other than the binding's soapAction. I know this violates W3C protocol, but the web services are another party's and cannot be changed.

I code (where "transport" is the WebServicesClientProtocol object) :

transport.RequestSoapContext.Addressing.Action = new Microsoft.Web.Services2.Addressing.Action(reqAction);

and can see in the VS debugger that it sets the action, but when I call the method to send the web request the <wsa:Action> is reset to the same value as the soapAction in the HTTP header. I assume WSE 2.0 is doing this. Can a custom SoapOutputFilter help me to "manually override" the <wsa:Action>?

If I abandon WSE 2.0 (which I kno

how to distinct values of sharepoint custom list using SSRS (new from http://social.msdn.microsoft.c


i hope jin chen would read this.

i followed his instruction from the link above(in the title)

i still got an error message :

System.Web.Services.Protocols.SoapException: An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC42105] Function 'RemoveDups' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.’.
   at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.SetReportDefinition(String Report, Byte[] Definition, Warning[]& Warnings)
   at Microsoft.ReportingServices.WebServer.ReportingService2010Impl.SetItemDefinition(String ItemPath, Byte[] Definition, Property[] Properties, Warning[]& Warnings)
   at Microsoft.ReportingServices.WebServer.ReportingService2010.SetItemDefinition(String ItemPath, Byte[] Definition, Property[] Properties, Warning[]& Warnings)

could anybody tell me what's wrong?

and by the way,

i'm using ssrs 2008 r2

i use report builder(content type) to create reports from sharepoint lists.

thx in advance.



Cant read registry during custom action

I have built an installer project that uses a custom action that fires during the AfterInstall event.  I am having a strange problem with this code in Windows 7 64 bit that I am not having under Vista 32 bit.  The problem is that in the 64 bit version, a particular registry key that I need to read is showing up as not having any values, even though it definitely contains over 30 values.  Opening the key does not throw an exception - it just doesn't appear to contain any values.  If I execute my code from an EXE and execute it in Windows 7 64 bit, it does not have this problem - the problem only occurs when I call the code from within the context of the custom action and the custom action works fine on 32 bit vista.  The registry key that I am reading ALREADY EXISTS on the machine - my installer is not creating any keys.  I am totally stumped on this one.  Anybody have an idea about what might be going on here?  Thanks in advance for any suggestions or ideas.


Cant reuse Http connections. No KeepAlive header. HttpWebRequest.KeepAlive = true;


I tried to reuse Http connections setting KeepAlive but it simply doesnt work. I looked in the Http messages using Feedler and Charles but all I can see is Connection: close in response. I am sure I use HTTP 1.1 as it says so in the request.

I see 600 TCP connections in wait state opened by 10 threads. Each thread run one http request at a time.

There is also bunch of responses which say - the unauthenticated request. The service requires digest authentication. Why some requestes fail to be authenticated?? 

P.S. I just found this thread: http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/87bc7029-ce23-438a-a767-f7c32dcc63a7 and I tried to set UnsafeAuthenticatedConnectionSharing = true but still my TCP connections are not reused.

    static void GetRest(string rest) 

Powerpoint can't read the outline from http://it/presentation.ppt. No text converter is installed


I have a user on my sharepoint 2007 environment that has a Powerpoint file that continues to display this message.  Is there something that needs to be added to Sharepoint to enable this file to open?  Where is this supposed to be added?



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