我是MVC的新手。MVC頁面需要從多個模型中獲取數據
我有一個顯示類別列表的頁面。同一頁面還有一個文本框用於搜索類別。爲了在一個頁面中使用兩個模型,我需要做什麼?
namespace MvcWebsite.Models.User
{
public class ListOfCategories
{
public int lngCatId { get; set; }
public Byte intStatus { get; set; }
public string txtTitle { get; set; }
public ListOfCategories()
{
intStatus = 1;
}
}
public class SearchBox
{
public string txtSearch { get; set; }
}
}