In ASP.Net MVC I would like to render a different partial view depending on the renderview query string parameter.
Therefore providing the facility for the user to c
Paul's method is good, but if you decide you want to pass the int, you need to create a view model.
In your controller add this
public class ProductsFormViewModel
{
// Properties
public Products Products { get; private set; }
public int? Renderview { get; private set; }
// Constructor
public ProductsFormViewModel(Products p_products, int? p_renderView)
{
Products = p_products;
Renderview = renderView;
}
}
Then pass this into the view
return View(new ProductsFormViewModel(products, renderview);
And then in the view
Inherits="System.Web.Mvc.ViewPage"