I've declare a class for GlobalVarables in model.cs, in the same model there is also one more class which represent my table in the database.
namespace Project.Models { [Table("REGIONS")] public class DBTable { // table columns{get;set;} } public static class MyViewModel { public static string vVar1{get; set;} public static string vVar2{get; set;} } then papulate in Controller.
namespace Project.Controllers { public class ProjectController : Controller { public ActionResult DisplayVariables(MyViewModel model) { model.Var1 = "testString"; return View(model); } .... } } index.cshtml code here
@model IEnumerable<sLightcSharp.Models.Region> how can I include second model
@model IEnumerable<sLightcSharp.Models.MyViewModel> and how can I use Var1 variable in index.cshtml.