This question is locked. New answers and comments are not allowed.
Hi all,
I keep using the same code over and over on my Views but not sure how I could move this to one single file and re-use it.
I tried @Html.Partial("FileName.cshtml") but it did not work. Here is my code:
The Grid depends on all these variables so I get a bunch of errors?
Any way to render this View by reusing the code above?
Thank you!
I keep using the same code over and over on my Views but not sure how I could move this to one single file and re-use it.
I tried @Html.Partial("FileName.cshtml") but it did not work. Here is my code:
@model IEnumerable<Test.DataModel.Model1> <div id = "gridReusableCode">@{ GridButtonType buttonType = GridButtonType.Image; GridEditMode gridEditMode = GridEditMode.InLine; GridPagerPosition pagerPosition = GridPagerPosition.Bottom; GridPagerStyles pagerStyles = GridPagerStyles.NextPreviousAndNumeric; GridSortMode gridSortMode = GridSortMode.SingleColumn;...}</div>@(Html.Telerik().Grid(Model) .Name("Grid1")...etc...Any way to render this View by reusing the code above?
Thank you!