troubleshooting Question

ASP.NET/C#/VB: Convert Header Management Code from VB to C#

Avatar of hankknight
hankknightFlag for Canada asked on
C#ASP.NETVisual Basic.NET
2 Comments1 Solution925 ViewsLast Modified:
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);
	}
    }
}
How can my code be changed into VB code to avoid this problem?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros