views:

131

answers:

0

I am working in a hybrid MVC/Classical ASP.NET web application and I have to rewrite a URL at the controller level (because at a later stage I will be using a PageView, but for now it would be using the classical ASP.NET one), similar to this:

public void Index(int Id) {
  HttpContext.Current.RewritePath("~/classic-aspnet-page.aspx?id=" + Id, false);
}

Howver, this doesn't work and will return an empty page...

I am aware that I can do this by implementing a route handler, however, the reason I want this to be at the controller level is to reduce the code change when moving to a PageView.

Any suggestions for rewriting?