我是用dreamweaver编写的!这些代码,我都是照着书上输入的,但就不知道是什么原因,还请大家帮帮忙! 
以下是出错的提示: 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.  Parser Error Message: The 'user' start tag on line '7' doesn't match the end tag of 'credentials' in file 'file:///E:/web/test/web.config'. Line 8, position 6. Source Error:  
Line 6:              <user name="ron" password="AB54B7H109AE41F0"> 
Line 7:              <user name="scott" password="0f14AE901H7b45BA"> 
Line 8:           </credentials> 
Line 9:           </forms> 
Line 10:       </authentication> 
  
有三个文件,文件名和代码都在下面 
web.config 
<configuration> 
   <system.web> 
      <authentication mode="forms"> 
         <forms name=".aspxauth" loginurl="/login.aspx" protection="encryption"> 
         <credentials paswordformat="sha1"> 
            <user name="ron" password="AB54B7H109AE41F0"> 
            <user name="scott" password="0f14AE901H7b45BA"> 
         </credentials> 
         </forms> 
      </authentication> 
       
      <authorization> 
         <allow users="ron,scott"/> 
         <deny user="*"/> 
      </authorization> 
   </system.web> 
</configuration> 
login.aspx 
<%@ Import Namespace="System.Web" %> 
<%@ Import Namespace="System.Web.UI.WebControls" %> 
<%@ Import Namespace="System.Web.Security" %> 
<script language="vb" runat="server"> 
   public sub loginbutton_onclick(sender as object, e as eventargs) 
      if formsauthentication.authenticate(username.text,password.text) then 
         formsauthentication.redirectfromloginpage(username.text,persist.checked) 
      else 
         errorlabel.text="invalid username/password combination" 
      end if 
   end sub 
</script> 
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>无标题文档</title> 
</head> 
<body><asp:Label ID="errorlabel" runat="server"></asp:Label> <p>username:<asp:TextBox ID="username" runat="server" TextMode="SingleLine" /></p> 
<p>password:<asp:TextBox ID="password" runat="server" TextMode="Password" /></p> 
<p><asp:CheckBox ID="persist" runat="server" Text="keep me logged in between browser restarts" /> </p> 
<p><asp:LinkButton ID="loginbutton" runat="server" Text="log in" OnClick="loginbutton_onclick"></asp:LinkButton> </p> 
</body> 
</html> 
default.aspx 
<%@ Import Namespace="System.Web" %> 
<%@ Import Namespace="System.Web.UI.WebControls" %> 
<%@ Import Namespace="System.Web.Security" %> 
<script language="vb" runat="server"> 
   public sub signoutbutton_onclick(sender as object,e as eventargs) 
      formsauthentication.signout() 
      response.Redirect("/login.aspx") 
   end sub 
</script> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>无标题文档</title> 
</head> 
<body> 
<p>WELCOME</p> 
<p>this is a secure page.</p> 
<p><asp:LinkButton ID="signoutbutton" runat="server" Text="sign out" OnClick="signoutbutton_onclick"></asp:LinkButton>   </p> 
</body> 
</html> 

解决方案 »

  1.   

    Web.config用vs.net新建工程生成最好,dw只写页面的布局,你这样全用dw写,写多了,不定哪就会出错了
      

  2.   

    少写了一个字符 :pLine 6:              <user name="ron" password="AB54B7H109AE41F0"> 
    ==>
    Line 6:              <user name="ron" password="AB54B7H109AE41F0"/> xml文件要求比html严格,“/>”是tag结束的规范
      

  3.   

    athossmth(athos) 看出来了
    <user name="ron" password="AB54B7H109AE41F0"> 
    <user name="scott" password="0f14AE901H7b45BA"> 
    都没有结束标记
      

  4.   

    我照athossmth(athos)改了,这个错误过去!谢谢,楼上的两位!
    现又有一个新的错误发生了分析器错误信息: 无法识别的属性“LoginUrl”。源错误: 
    行 2:   <system.web>
    行 3:   <authentication mode="Forms">
    行 4:   <forms name=".ASPXAUTH" LoginUrl="/login.aspx" Protection="Encryption">
    行 5:   <credentials passwordformat="clear">
    行 6:   <user name="Ron" password="AB54B7H109AE41F0" />
     完事后,一起加分!
      

  5.   

    <authentication mode="Forms" > 
    <forms loginUrl="login.aspx"></forms>
    </authentication>
    <authorization>
    <deny users="?"/>
    </authorization>
    仅供参考!!
      

  6.   

    loginUrl  不是LoginUrl web.config里的属性都是要区分大小写的。