Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我发布了一个简单的动作。
public void Login(FormCollection formCollection) { ... }
即使查询字符串值很少,formcollection.Count也是0。是靠行为吗?
formcollection.Count
FormCollection 使用 POST 值,而不是查询字符串中的内容。您的操作应如下所示:
[AcceptVerbs(HttpVerbs.Post)] public ActionResult Login(FormCollection formCollection) { ... }