LoginView & ASP.NET Membership help

E

eschneider

Hello,

I'm trying to use the LoginView control with roles. The roles are in sql server (ASP.NET membership). I can login but the when I go to the page with the LoginView control it can't determine the user role and also creates a access db. Does not seem to be able to connect to the DB, but I'm not sure what I'm doing wrong. Would be nice if it just gave me an error instead of creating a new DB. I'm betting this probably a config issue, seems to be common problem...

Any help would be appreciated.

Thanks,
Eric


<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
CodeFile="Downloads.aspx.vb" Inherits="Downloads" %>

<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
Anonymous
</AnonymousTemplate>
<LoggedInTemplate>
Logged in
</LoggedInTemplate>
<RoleGroups>
<asp:RoleGroup Roles="CommercialUse">
<ContentTemplate>
Member of CommercialUse
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="NonCommercialUse">
<ContentTemplate>
Member of NonCommercialUse
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
</asp:Content>



<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<connectionStrings>
<add name="MySqlConnection" connectionString="Data Source=SCHNEIDER-LT\SQL2008;Initial Catalog=ssoft;Integrated Security=SSPI;"/>
</connectionStrings>

<system.web>
<authentication mode="Forms" />

<!--<authentication mode="Forms">
<forms loginUrl="login.aspx" name=".ASPXFORMSAUTH"/>
</authentication>-->

<!--<authorization>
<deny users="?"/>
</authorization>-->

<roleManager cacheRolesInCookie="true" cookieName=".MyRolesCookie" enabled="true">
<providers>
<add name="SqlProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="MySqlConnection" applicationName="MyMembership"/>
</providers>
</roleManager>

<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<!--<clear/>-->
<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="MySqlConnection" applicationName="MyMembership" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed"/>
</providers>
</membership>

<compilation debug="true"/>
</system.web>

</configuration>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top