VS2005
I'm using the SqlTableProfileProvider (VB version).
I have created a user and added 2 new properties that I need to fill in when user is validated.
Here is a copy of the portion of the web.config and the code behind
The problem is that I get "The settings Properties "AgentID" was not found"
What Do I have wrong or missing?
Code behind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Membership.ValidateUser(tb
UserID.Tex
t, tbPassword.Text) Then
FormsAuthentication.SetAut
hCookie(tb
UserID.Tex
t, chbRememberUserID.Checked)
Profile.AgentID = 990 <<<<<<===== here is the error
End If
End Sub
Web.Config Portion:
<connectionStrings>
<add name="PrivateSite" connectionString="data source=MIADEV; DataBase=WebDB; Uid=WebUser; Pwd=webdev1$"/>
</connectionStrings>
<authentication mode="Forms">
<forms loginUrl="Login.aspx"
protection="All"
timeout="30"
name="AppNameCookie"
path="privatesite"
requireSSL="false"
slidingExpiration="true"
defaultUrl="home.aspx"
cookieless="UseCookies"
enableCrossAppRedirects="f
alse"/>
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
<membership defaultProvider="PSiteMemb
ershipProv
ider">
<providers>
<add connectionStringName="Priv
ateSite"
enablePasswordRetrieval="f
alse"
enablePasswordReset="true"
requiresQuestionAndAnswer=
"true"
applicationName="/"
requiresUniqueEmail="false
"
passwordFormat="Hashed"
maxInvalidPasswordAttempts
="5"
minRequiredPasswordLength=
"6"
minRequiredNonalphanumeric
Characters
="0"
passwordAttemptWindow="10"
passwordStrengthRegularExp
ression=""
name="PSiteMembershipProvi
der"
type="System.Web.Security.
SqlMembers
hipProvide
r, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d
50a3a" />
</providers>
</membership>
<profile enabled="true" defaultProvider="SqlTableP
rofileProv
ider">
<providers>
<clear/>
<add name="SqlTableProfileProvi
der"
type="SqlTableProfileProvi
der"
connectionStringName="Priv
ateSite"
table="aspnet_UserProfiles
"
applicationName="/"/>
</providers>
<properties>
<add name="AgentID" type="int" customProviderData="AgentI
D;int;true
"/>
<add name="AgentName" defaultValue="[null]" customProviderData="AgentN
ame;nvarch
ar;true"/>
</properties>
</profile>
<roleManager defaultProvider="PSiteRole
Provider">
<providers>
<add connectionStringName="Priv
ateSite"
applicationName="/"
name="PSiteRoleProvider"
type="System.Web.Security.
SqlRolePro
vider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d
50a3a" />
<add applicationName="/"
name="PSiteWindowsTokenRol
eProvider"
type="System.Web.Security.
WindowsTok
enRoleProv
ider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d
50a3a" />
</providers>
</roleManager>
Start Free Trial