我有一个使用 Windows 身份验证的 asp.net 应用程序。
然而我遇到了麻烦:
<location path="default.aspx">
<system.web>
<authorization>
<deny users="mlabs\ksmith"/>
<allow roles="mlabs\Group2Users" />
</authorization>
</system.web>
</location>
当我运行它时,出现此错误:
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'ASP.default_aspx' does not contain a definition for 'SqlDataSource1_Selecting' and no extension method 'SqlDataSource1_Selecting' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 143: </ItemTemplate>
Line 144: </asp:FormView>
Line 145: <asp:SqlDataSource ID="SqlDataSource1" runat="server"
Line 146: ConnectionString="<%$ ConnectionStrings:qcvalues_testConnectionString %>"
Line 147: SelectCommand="SELECT * FROM [batchinfo]"
Source File: c:\Documents and Settings\agordon\My Documents\Visual Studio 2008\Projects\EnterData\EnterData\Default.aspx Line: 145
Show Detailed Compiler Output:
Show Complete Compilation Source:
Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618
有人知道我做错了什么吗?
答案1
这看起来不像与身份验证有关——死机黄屏甚至没有提到身份验证,并且明确地指向您的代码。
它提到了 SQL,那么您的连接字符串设置正确吗?
或者,SqlDataSource1_Selecting
听起来像一个事件 - 您是否正确处理它或者您是否甚至声明了该方法?
无论如何,我想说这是你的代码有问题,而不是身份验证模式有问题。