问题标签 [asp.net-mvc-futures]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
302 浏览

asp.net-mvc - 是否有 ASP.NET MVC Futures 的官方页面?

我计划将Mvc.Futures集成到我的项目中,但找不到该库的任何官方文档。

nuget.org上的官方项目页面指向 codeplex 上的旧asp.net项目页面,甚至不清楚在哪里可以找到有关 Futures 的信息。

我可能会遗漏一些东西,但如果有人能给我指点正确的地方,我将不胜感激。

谢谢。

0 投票
1 回答
4285 浏览

asp.net-mvc-5 - 在 MVC 5 期货中找不到 Html.Serialize 助手

我刚刚使用包管理器在我的解决方案中安装了 MVC 5 futures,但我找不到这个帮助方法Html.Serialize,它在以前的 MVC Futures 版本中有。

我的问题:我需要包含什么命名空间才能开始将 Html.Serialize 辅助方法与 MVC 5 Futures 一起使用?

0 投票
1 回答
1022 浏览

c# - 使用异步控制器的强类型 RedirectToAction (Futures)

有这个代码它给了我一个警告:Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

如果我确实添加了await运算符,我会得到:

Error CS4034 The 'await' operator can only be used within an async lambda expression. Consider marking this lambda expression with the 'async' modifier.

如果我async像这样添加修饰符:

错误是Error CS1989 Async lambda expressions cannot be converted to expression trees

那么如何将强类型的 RedirectToAction(我正在使用 MVC Futures)与异步控制器一起使用?

0 投票
1 回答
195 浏览

c# - 使用 MVC 期货在模型中传递 FormAction

对于 3 个不同的控制器,我的观点或多或少完全相同。唯一的区别是他们在哪里张贴表格。所有这些控制器都派生自同一个基类,并且视图包含一个表单,该表单将发布到该基类中的一个操作。

我的观点目前看起来像这样:

上面的视图工作正常。但我想将它重用于另一个也继承相同基本控制器(并发布到EditContactPerson操作)的控制器。因此,我想在模型中指定要发布到哪个控制器。我知道我可以这样使用字符串重载

或者

但我真的想改用表达式,如下所示:

有没有办法可以使用模型使用模型中的表达式来呈现表单?

类似于:

0 投票
2 回答
1176 浏览

asp.net-mvc-5 - 在运行时从 asp.net mvc 控制器/动作生成 Url

我有这样一个网址:

我需要这样的方法:

我需要从 .cs 类而不是 razor html 文件中调用上述方法。

我怎样才能做到这一点?我听说过 asp.net mvc 期货,但我找不到合适的方法或命名空间来使用该方法。