Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

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.vb use a different language, which is not allowed since they need to be compiled together.
When using this code:
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);
	}
    }
}

Open in new window

How can my code be changed into VB code to avoid this problem?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hankknight

ASKER