LoginView & ASP.NET Membership help




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.


<%@ 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 ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:LoginView ID="LoginView1" runat="server">
Logged in
<asp:RoleGroup Roles="CommercialUse">
Member of CommercialUse
<asp:RoleGroup Roles="NonCommercialUse">
Member of NonCommercialUse

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

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

<authentication mode="Forms" />

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

<deny users="?"/>

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

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

<compilation debug="true"/>



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