Well, what you can do is create a folder in your project, name it Shared , in this new section you can create Views / Scripts that you can then implement / share with all the views you want without need to always write the same.
For example:
Folder Shared | _Vista1.cshtml
@Scripts.Render("~/bundles/datatable")
@Scripts.Render("~/bundles/datatable.default")
@Scripts.Render("~/bundles/datatable.buttons")
Or another example _Selector.cshtml :
<div class="form-group">
@using (Html.BeginForm(null, null, FormMethod.Get, new { @class = "form-inline" }))
{
<div class="form-group">
@Html.Label("Hasta")
<input id="hasta" type="text" name="hasta" data-provide="datepicker" class="form-control" placeholder="Hasta" value="@ViewBag.Hasta.ToShortDateString()" />
</div>
}
</div>
Now in your View you only call these views through the attribute section Script
and Html.Partial
(Html Helpers) at the end of your view (if they are Scripts) and in case it is Content display you place it where you want .
Script:
@section scripts
{
@Html.Partial("_Vista1")
}
Content:
@section content
{
@Html.Partial("_Selector")
@Styles.Render("~/content/bootstrap-multiselect")
}
I hope I have given you a hand.
Greetings, comment on any concerns.