我有一个使用Windows身份validation的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
有谁知道我做错了什么?
这看起来并不像身份validation – 死亡的黄色屏幕甚至没有提及身份validation,并且非常明确地指向您的代码。
它提到SQL,所以你有连接string设置正确?
或者, SqlDataSource1_Selecting听起来像一个事件 – 你正确处理它,或者你甚至宣布这种方法?
无论如何,我会说这是你的代码有问题,而不是authentication模式。