62,074
社区成员
发帖
与我相关
我的任务
分享
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
if (not(HttpContext.Current.User is Nothing)) then
if HttpContext.Current.User.Identity.AuthenticationType = "Forms" then
Dim id as System.Web.Security.FormsIdentity
id = HttpContext.Current.User.Identity
Dim MyRoles(2) As String
MyRoles(0) = "Manager"
MyRoles(1) = "Admin"
HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id,MyRoles)
End if
End if
End sub
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Pubs %>"
SelectCommand="SELECT [au_id], [au_lname], [au_fname], [state] FROM [authors]"
UpdateCommand="UPDATE [authors] SET [au_id] = @au_id, [au_lname] = @au_lname,
[au_fname] = @au_fname, [state] = @state WHERE [au_id] = @original_au_id"
DeleteCommand="DELETE FROM [authors] WHERE [au_id] = @original_au_id"/>