wizardproviderinfo.ascx

来自「《圣殿祭司的ASP.NET 2.0开发详解——使用C#》光盘内容.包含了书籍所含」· ASCX 代码 · 共 42 行

ASCX
42
字号
<%@ Control Inherits="System.Web.Administration.WebAdminUserControl" %>
<%@ Import Namespace="System.Web.Administration" %>
<%@ Import Namespace="System.Web.Configuration" %>


<script runat="server" language="cs">
private string ApplicationPath {
    get {
        return (string)Session["WebAdminApplicationPath"];
    }
}

public void Page_Load() {
    System.Configuration.Configuration config = ((WebAdminPage)Page).OpenWebConfiguration(ApplicationPath);
    MembershipSection membershipSection = (MembershipSection)config.GetSection("system.web/membership");
    RoleManagerSection roleManagerSection = (RoleManagerSection)config.GetSection("system.web/roleManager");
    ConnectionStringsSection connectionStringSection = (ConnectionStringsSection)config.GetSection("connectionStrings");

    string defaultProvider = membershipSection.DefaultProvider;
    string connectionStringName = membershipSection.Providers[defaultProvider].Parameters["connectionStringName"];
    if (defaultProvider == roleManagerSection.DefaultProvider &&
        connectionStringName == roleManagerSection.Providers[defaultProvider].Parameters["connectionStringName"]) {
        label1.Text = defaultProvider;
    }
    else {
        label1.Text = (string)GetLocalResourceObject("AdvancedSettings"); 
    }

}
</script>

<table border="0" cellpadding="0" cellspacing="0" width="100%" >
<tr><td class="bodyTextLeftPadding5">
<asp:literal runat="server" text="<%$ Resources:CurrentlyConfigured %>" />
<br/><br/>

<asp:label runat="server" id="label1" font-bold="true" text="Unknown"/>

<br/><br/>
<asp:literal runat="server" text="<%$ Resources:ChangeInstructions %>"/>
</td></tr></table>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?