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

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

Add Expires headers to css, js

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

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

View Complete Post

More Related Resource Links

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.

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" ;

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

execute update timedout expires , table with trigger due to recovery of database


I have table A in database A  , in table A i have trigger to insert record to database B table A, each update and insert of database A -table A, triiger fire and insert record in database B table A, when i try to update some times asp.net application gives error

"Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

and then error log says System.Data.SqlClient.SqlException: Database 'database B is being recovered. Waiting until recovery is finished.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean ret

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

can do rowspan+columnspan in DataGrid Column Headers?

i wanna do something like this: 4 column headers: Header Font, Header Size, Cell Font, Cell Size you can see they are 2 grps, with a pair of each. now i wanna create the column headers like:     Header  |     Cell Font | Size  | Font | Size is it possible? and how to do that?

WCF Message Inspectors and Response Headers

I have a question about setting http headers in a wcf message inspector. My requirement is to record the size of the results of a wcf call by our partners to our server to a log file for analysis. When the call is made our partners send in various info in the http headers such as their vendor id. I can of course see this fine during the AfterReceiveRequest, but not in the BeforeSendReply call. Is there a way to set the response https headers during the AfterReceiveRequest? Or is there another way to do this? Thanks, DavidMicrosoft MVP

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  

Content-Encoding Headers Being Removed?

Hello everyone. I've got a question.So I have an HttpModule that compresses the response with either gzip or deflate. Here's the code:     public class CompressionModule : IHttpModule    {        public void Dispose()        {        }        public void Init(HttpApplication context)        {            context.ReleaseRequestState += new EventHandler(context_ReleaseRequestState);            context.PreSendRequestHeaders += new EventHandler(context_PreSendRequestHeaders);        }        void context_ReleaseRequestState(object sender, EventArgs e)        {            // Get the application.            HttpApplication app = (HttpApplication)sender;            // The Accept-Encoding header from the client's browser.            string acceptE

Styling of GridView with Multiple Headers

Hi,    I want to implement GridView with multiple headers in  WPF. The requirement is such that GridView should show the headers as shown below: Detail info Name ID PhoneNumber   The sample Xaml Code with  which I was able to attain the above GridView presentation of Headers is given below:   XAML code: <Window x:Class="WpfNestedHeaderListView.Window2"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Window2" Height="300" Width="300">     <UserControl.Resources> <CollectionViewSource       x:Key="PatientInfo"       Source="{Binding Path=DocContext.PatientInformation}"/>   <Style x:Key="HeaderStyle" TargetType="{x:Type GridViewColumnHeader                <Setter Property="Template">                 <Setter.Value>                     <ControlTemplate T

styling of gridview with multiple headers

Hi,    I want to implement GridView with multiple headers in  WPF. The requirement is such that GridView should show the headers as shown below: Detail info Name ID PhoneNumber   The sample Xaml Code with  which I was able to attain the above GridView presentation of Headers is given below:   XAML code: <Window x:Class="WpfNestedHeaderListView.Window2"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Window2" Height="300" Width="300">     <UserControl.Resources> <CollectionViewSource       x:Key="PatientInfo"       Source="{Binding Path=DocContext.PatientInformation}"/>   <Style x:Key="HeaderStyle" TargetType="{x:Type GridViewColumnHeader                <Setter Property="Template">                 <Setter.Value>                     <ControlTemplate T
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