您的位置:首页 > 编程语言 > ASP

VS2005:Asp.net Web Site Administration Tool

2006-05-05 11:27 435 查看
详细介绍参考《ASP.NET 2.0中的登陆控件简介
其中文中提及到的Asp.net Web Site Administration Tool中Security需要一些相关的设置才可以应用,具体设置方法如下:
(Microsoft MSDN:http://forums.microsoft.com/msdn/showpost.aspx?postid=81990&siteid=1&PageID=0

在你的SQL服务器上建立ASP.NET 2.0的应用程序支持数据,需要建立一些表,缺省是放在aspnetdb的数据库里面。而安装时并没有生成aspnetdb数据库所以出错。

首先,运行 aspnet_regsql(C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/aspnet_regsql.exe) 来安装membership所要建立的数据库。
然后,修改机器上web.config文件(C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/CONFIG/web.config)或者是工程的web.config文件。我的工程下的web.config文件如下:
   要注意<connectionStrings> ... </connectionStrings>这个节
 
<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    /Windows/Microsoft.Net/Framework/v2.x/Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
 <appSettings/>
 <connectionStrings>
      <remove name="LocalSqlServer" />

      <add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=aspnetdb;Integrated Security=True"
       providerName="System.Data.SqlClient" />

   
  <add name="NorthwindConnectionString" connectionString="Data Source=.;Initial Catalog=Northwind;Persist Security Info=True;User ID=sa;Password=vivian"
   providerName="System.Data.SqlClient" />
 </connectionStrings>
 <system.web>
  <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
  <compilation debug="true"/>
  <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
  <authentication mode="Windows"/>
  <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
 </system.web>
</configuration>

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息