hankknight
asked on
ASP.NET/C#/VB: Convert Header Management Code from VB to C#
I get this error:
The files /App_Code/customheader.cs and /App_Code/customfunctions.When using this code:vb use a different language, which is not allowed since they need to be compiled together.
using System.Web;
using System.IO;
namespace org.header_hack
{
public class RemoveETagModule : IHttpModule
{
public void Dispose() { }
public void Init(HttpApplication context)
{
context.PreSendRequestHeaders += OnPreSendRequestHeaders;
context.PreRequestHandlerExecute += new EventHandler(OnPreRequestHandlerExecute);
}
void OnPreSendRequestHeaders(object sender, EventArgs e)
{
HttpContext.Current.Response.Headers.Remove("ETag");
HttpContext.Current.Response.Headers.Remove("Vary");
}
public void OnPreRequestHandlerExecute (Object source, EventArgs e)
{
String url = HttpContext.Current.Request.FilePath.ToString();
String ext = Path.GetExtension(url);
}
}
}
How can my code be changed into VB code to avoid this problem?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
https://www.experts-exchange.com/questions/28178600/IIS-7-5-ASP-NET-VB-Cache-Control-and-Vary-Headers.html