[ASP.NET MVC] 指令問題>> 在controlller裡寫where拿出選定 ... | 首都客運時刻表查詢網
![[ASP.NET MVC] 指令問題>> 在controlller裡寫where拿出選定 ...](https://i.imgur.com/2oxSoeJ.png)
2015年7月28日—接著我想說不如換成符合MVC架構的方式--在controller裡拿好東西後再丟給view呈現.參考了我上個問題一位大大靠後的回覆的方式.(以下引用自那個回復).
![[ASP.NET MVC] 指令問題>> 在controlller裡寫where拿出選定 ...](https://i.imgur.com/2oxSoeJ.png)
但這樣會一直有紅色底線表示錯誤:
stringdoesnt contain a definition for Where and the best extension method overload System.Linq.Emunerable.Where<TSource>(.....省略.....) has some invalid arguments
不知道錯誤在哪裡?我的orgID和userID型態都是int,也有試著把==換成.Equals,但這樣還是不行
這是我嘗試的第一個方式(直接在view裡向model拿資料)
你好,
我看了一下你的寫法,你可能要了解一下關於型別還有Linq。
會這麼說是因為 不是甚麼型別都擁有 Where這樣的方法。
UserName本身是string型別,所以你在"UserName.Where(.." 這樣的寫法 是語法錯誤!
錯誤訊息也告訴你了 stringdoesnt contain a ...
mvc查詢範例 MVC 關鍵字查詢 mvc搜尋 Mvc linq where and MVC where C# where clause Model MVC C# MVC mvc查詢範例 MVC 關鍵字查詢 mvc搜尋 Mvc linq where and MVC where C# where clause Model MVC C# MVC Asp NET 搜尋功能 C# 搜尋功能 MVC 題目 Asp search ASP NET 練習 Pagedlistpager POST ASP .net MVC 鐵人賽 MVC 加入 檢視 Dotnet new mvc mvc網站範例 MVC C# 範例 mvc架構範例 MVC 關鍵字 搜尋 Asp NET MVC 練習 mvc範例 和欣客運台南停靠站 1573票價 台南公車時刻表3號 20號公車時刻表 516莒光 1238車次 黃6 5616 票 價
ASP.NET MVC 從入門到放棄(Day21) | 首都客運時刻表查詢網
2021年9月26日 — 接下來講講查詢部分... Controller public ActionResult Index(string id) String SearchString = id; try if (... Read More
How to use a where clause in MVC ef | 首都客運時刻表查詢網
2012年4月18日 — Using MVC EF, how would I filter results by a field other than the id? return View(db.Drafts.Where(PublicationId=id));. PublicationId is a ... Read More
[ASP.NET MVC] 指令問題>> 在controlller裡寫where拿出選定 ... | 首都客運時刻表查詢網
2015年7月28日 — 接著我想說不如換成符合MVC架構的方式--在controller裡拿好東西後再丟給view呈現. 參考了我上個問題一位大大靠後的回覆的方式. (以下引用自那個回復). Read More
[ASP.NET MVC] 新增查詢功能 | 首都客運時刻表查詢網
2016年8月26日 — [ASP.NET MVC] 在Index新增查詢功能,依照電影名稱與類型查詢電影。 修改Index Form. 首先,先修改MoviesController的Index Action方法: public ... Read More
第7部分:將搜尋新增至ASP.NET Core MVC 應用程式 | 首都客運時刻表查詢網
2021年9月27日 — ASP.NET Core MVC 之教學課程系列的第7部分。 Read More
相關資訊整理