c# - 在 asp.net mvc4 中类顶部的 InitializeSimpleMembership 注释的目的

标签 c# asp.net .net asp.net-mvc

<分区>

我在网上搜索过,但没有找到关于其真正用途的明确答案。

我认为它与成员资格和 WebSecurity 属性有关。

有人能阐明它的真正目的吗?

最佳答案

来自 Rick_Anderson 的博文 InitializeSimpleMembership Attribute and SimpleMembership Exceptions

The InitializeSimpleMembership Attribute ensures that before any membership (login/register) related functionality is run, that the membership database has been created. If the database is not yet created, the code will automatically create one. If the simple membership initialization fails, the Web Application can continue to run requests that don’t require membership.

关于c# - 在 asp.net mvc4 中类顶部的 InitializeSimpleMembership 注释的目的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15435898/

相关文章:

c# - 如何将 SQL Server 表中的行以 10000 行 block 的形式流式传输到 .NET 应用程序中?

c# - 在 C# 中执行参数化查询时出现 ORA-01745 错误

c# - 在 Mono 中捕获窗口或小部件的图像

c# - 如何在 WPF 中沿路径绘制平行线

asp.net - Entity Framework ,将列更改为只读

c# - 远程服务器返回错误 : (403) Forbidden in Asp.net C# Instagram.(HttpWebRequest)

c# - 使用 Newtonsoft.json 自定义反序列化

c# - Azure 上的 GhostScriptSharp

javascript - 如何使用 Mechanize 提交 javascript 表单?

C# Streamreader - 仅在 {CR}{LF} 处中断