troubleshooting Question

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

Avatar of hankknight
hankknightFlag for Canada asked on
ASP.NETC#Visual 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)

	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?
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
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