i have this controller :
- public ActionResult search(int? page, string search , string KEYWORD_NAME)
- {
- if (search == null)
- {
- Bindkeyword();
- return View();
- }
- else
- {
- KEYWORD_NAME = Request.QueryString["Contant.KEYWORD_NAME"];
- Bindkeyword();
- DataSet dst = new DataSet();
- dst.Tables.Add(op.search(search, KEYWORD_NAME));
- List
seaech = new List (); - foreach (DataRow dr in dst.Tables[0].Rows)
- {
- ContantViewModel u = new ContantViewModel();
- u.articalname = dr["ARTICAL_NAME"].ToString();
- u.articalbody = dr["ARTICALBODY"].ToString();
- u.userName = dr["IUSER"].ToString();
- u.articlid = dr["ARTICL_ID"].ToString();
- seaech.Add(u);
- }
- if (seaech.Count > 0)
- {
- op.addsearch(search, KEYWORD_NAME);
- return View(seaech.ToPagedList(page ?? 1, 10));
- }
- else
- {
- ContantViewModel u = new ContantViewModel();
- u.s = "there is no data ";
- u.s1 = "e.jpg";
- seaech.Add(u);
- return View(seaech.ToPagedList(page ?? 1, 10));
- }
- }
- }
and this is the view
i use this model :@model Wiki_Reach_Site.Models.ContantViewModel
i have error in the line in BOLD
this is the error
System.InvalidOperationException: The model item passed into the dictionary is of type 'PagedList.PagedList`1[Wiki_Reach_Site.Models.ContantViewModel]', but this dictionary requires a model item of type 'Wiki_Reach_Site.Models.ContantViewModel'.
how i can fix it ?

Sachin SinghRank #66 · 26.2K reputationPosted Sep 29, 2020, 7:05 AM EDT
أماني مفيد174 reputationPosted Sep 29, 2020, 9:21 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Sep 29, 2020, 10:18 PM EDT
أماني مفيد174 reputationPosted Sep 29, 2020, 10:30 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Sep 29, 2020, 10:41 PM EDT
using PagedList;أماني مفيد174 reputationPosted Sep 29, 2020, 10:45 PM EDT
here
Sachin SinghRank #66 · 26.2K reputationPosted Sep 29, 2020, 10:52 PM EDT
Junaid MuslaRank #8,429 · 222 reputationPosted Sep 29, 2020, 10:55 PM EDT
أماني مفيد174 reputationPosted Sep 29, 2020, 10:59 PM EDT