问题标签 [fubumvc]

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 回答
156 浏览

fubumvc - FubuMvc 1.0 中的验证

我是使用 FubuMvc 的新手,我最近更新到没有任何文档的 1.0 版,而且代码中似乎有很多重大更改,我试图了解验证规则和验证的一般工作原理扶布。

即使我导入 FubuMVC.Validation 也找不到验证方法

是否有任何新方法,我只是想清楚验证如何在 fubu 中发生的概念。

我可以应用约定进行验证吗?示例:对包含名为“电子邮件”的字段的所有实体应用标准格式的正则表达式验证。

0 投票
1 回答
95 浏览

c# - 使用 FubuMvc 进行集成测试

我在想拥有这样的东西会很棒:

所以问题是:用 FubuMvc 做这个有多容易?

谢谢!

0 投票
2 回答
200 浏览

c# - FubuMvc:如何在 Razor 中使用布局?

非常简单的 helloworld fubumvc 应用程序,我无法使用 Razor 使其与布局一起使用。

这是一个示例代码: https ://gist.github.com/anonymous/4740987

0 投票
5 回答
11579 浏览

fubumvc - Web 服务器配置为不列出此目录的内容

使用 Visual Studio 2012:

  1. 我创建了一个“ASP.NET 空 Web 应用程序”(使用 C#)。
  2. 我使用 NuGet 安装FubuMVC包。
  3. 当我运行应用程序(使用 IIS Express)时,我得到“欢迎来到 FubuMVC!” 页面告诉我删除FubuMVC.GettingStarted.dll文件并设置主页。
  4. 所以我做了这两件事,实现了一个HomeController简单地"Hello World"Index.

我得到一个 IIS 错误,而不是预期的“Hello World”:The Web server is configured to not list the contents of this directory.

我做错了什么?

0 投票
1 回答
90 浏览

fubumvc - CurrentUserPropertyBinder 的问题,它不能总是记住用户

我已经为使用 FubuMVC 的 Web 应用程序实现了CurrentUserPropertyBinder(见下文)。

当我登录到我的网站时,这工作正常。CurrentUserPropertyBinder包含执行任务所需的所有信息(即_security.CurrentIdentity.Name中包含正确的用户详细信息)

当我尝试使用打开标准 fileDialog 的fineUploader(http://fineuploader.com/)导入文件时,_security.CurrentIdentity.Name为空。

它似乎不记得用户是谁,我不知道为什么。它适用于我的所有其他路线,但是我导入了一个文件,它不会记住用户。

请帮忙!提前致谢

注意:我们使用 FubuMVC.Authentication 来验证用户

0 投票
1 回答
90 浏览

model-binding - 在 FubuMVC 中绑定到空的 IEnumerable 会导致绑定错误

我的模型中有一个IEnumerable<string>有价值的属性,它从复选框数组中获取值。当没有选中任何复选框时,Fubu 会以绑定错误响应。

发生的事情是,Fubu 寻找各种潜在的价值来源。当它最终检查 Cookies 时,它会抛出一个异常:

绑定代码将此异常解释为绑定失败,并返回以下延续(“Packages”是属性的名称):

除了添加一个假的隐藏字段之外,我该如何正确地做到这一点?我正在使用最新的公共 NuGet:FubuCore 1.1.0 和 FubuMVC.Core 1.1.0。

0 投票
1 回答
45 浏览

fubumvc - One Event Behind when using FubuMVC.ServerSentEvents

We are currently working on implementing a notifications feature for our app we are developing for Windows Azure. We want to inform users when actions have taken place they are interested in (such as the importing and exporting of files and so on). This notification is specific to each logged in user.

We have been using ServerSentEvents and we have found that this list is one event behind. So we do not start seeing notifications until the second action has taken place and that notification is for the first action. In our dev environments this problem always happens, but in Azure it appears to work as expected (sometimes!!!)

We are using the default implementation of the Event Queue and Channel Initialiser. We publish via the EventPublisher.WriteTo method passing a topic and a serverevent.

Here is our implementation of Topic:

Implementation of our ServerEvent:

Any help, suggestions would be appreciated!

Thanks

Scott

0 投票
1 回答
702 浏览

jquery - 如果使用 iframe,IE 8 和 9 尝试下载 json 响应

我正在使用 blueimp fileUpload 插件将文件发送到服务器,并且在 ie 8 和 ie 9 中它会尝试提示我下载文件。当我打开文件时,它是完美的 json。

我尝试将内容类型设置为 text/plain 以及将 dataType 设置为 text/plain 但无济于事。

我也在使用 FubuMVC,所以我不能只返回一个字符串。如果它不是 json,那么它会尝试渲染视图。

0 投票
1 回答
77 浏览

twitter-bootstrap-3 - 创建 HtmlTag 控件时使用 .WrapWith

我正在为基于不可避免的 Twitter Bootstrap 框架的应用程序创建一些基于 Fubu 项目的HtmlTags 库的 HTML Helper 方法。对于大多数简单的控件,我直接子类化 HtmlTag 没有问题;然而,当涉及到通常需要嵌套在 div 标签中的更复杂的控件时,它会变得更复杂一些。

例如,我有一个 TextboxWidget,它的实现如下:

这很简单。然后可以像这样使用它(使用其他一些扩展方法):

给出想要的结果。

我对 DatepickerWidget 的实现是这样的:

然后像这样使用它:

但由于某种原因,没有呈现包装 div 标签。如果我为控件编写一些单元测试,那么我可以在对象模型中看到 div 标记(在 Parent 属性中),但它永远不会在页面上变成 HTML。

我真的很想将主输入元素作为控件的焦点元素,所以所有漂亮的 HtmlTag 扩展都挂在小部件上;我是否必须通过为控件中的每个单独元素公开修饰符来遵循 Jimmy Bogard 显示的路线?