View Single Post
  #22 (permalink)  
Old August 3rd, 2012, 09:34 AM
sophia sophia is offline
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts

So, as asked before, please be specific. Tell us if /Member is just a folder or a configured application, shows us the relevant code for the page behind /Member, tells us what you expect to fire and when etc....
Hi Imar, first of all thank you for looking at site.

I uploaded all the files on server as is, Member is a folder containing web.config to restrict unauthorized users.

Root web.config--
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web,             Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="8" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="20" passwordStrengthRegularExpression="" />

<location path="Manage">
        <allow roles="Managers" />
        <deny users="*" />

  <location path="Member">
        <deny users="?" />

    <add name="ASPNETDBEntities" connectionString="metadata=res://*/App_Code.ProOnline.csdl|res://*/App_Code.ProOnline.ssdl|res://*/App_Code.ProOnline.msl;provider=System.Data.SqlClient;provider connection string=&quot;workstation;packet size=4096;user id=******;pwd=******;data;persist security info=False;initial catalog=PropOnline;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="ConnectionString" connectionString="workstation;packet size=4096;user id=******;pwd=******;data;persist security info=False;initial catalog=PropOnline" providerName="System.Data.SqlClient" />

Member/web.config --

<?xml version="1.0"?>
        <allow roles="Managers,Members"/>
        <deny users="?" />

Member/Default.aspx.cs --

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using ASPNETDBModel;

public partial class Member_Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        using (ASPNETDBEntities myEntities = new ASPNETDBEntities())

            Guid userId = (Guid)Membership.GetUser().ProviderUserKey;
            var albums = (from a in myEntities.Albums
                         where a.UserId == userId
                         select a).Count().ToString();

            var clients = (from c in myEntities.Clients
                           where c.DealerId == userId
                           select c).Count().ToString();

            lblAlbums.Text = albums;
            lblClients.Text = clients;
I hope this is information what you need...