Trying to convert a partialview to to a List as well as pass in a variable, but I can't seem to get it to pass the variable. Included a snippet below, thanks for the help.
Here's what I want to do (but with a partial view, not an iframe.
<iframe src="/Episodes/Grid?seriesId=@Html.DisplayFor(model => model.SeriesID)"></iframe>
And here's how I'm trying to do it, but I can't get it to do both the conversion to a List and passing in the SeriesID variable at once.
@{
Html.RenderPartial("~/Views/Episodes/Grid.cshtml", new List<myA.Models.Episodes> { new myA.Models.Episodes() }; new { SeriesID = Model.SeriesID }););
}
As per adiga's suggestion, I created another model but I'm getting Internal server errors, see below.
Model
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace myA.Models
{
public class Combined
{
public IEnumerable<myA.Models.Episodes> Episodes { get; set; }
public string SeriesID { get; set; }
}
}
but I get
'IEnumerable<Episodes>' does not contain a definition for 'Number' and no extension method 'Number' accepting a first argument of type 'IEnumerable<Episodes>' could be found (are you missing a using directive or an assembly reference?)