N
nathan.haywood
I saw several posts, but no real answers about this. I've been playing
with the Profile classes in a sample Web Site, but cannot seem to get
the Profile to work in my actual Web Application Project. I am able to
add profile properties and/or profile inheritence to the web.config,
but IntelliSense never kicks in on any of my pages or code-behinds.
When I type Profile, it looks like I may be getting the
System.Web.Profile namespace instead of a page-level Profile
property/accessor?
Can anyone confirm that Profile works with Web Application projects and
that "Profile.MyProperty" works on pages in W.A. projects?
ex. (works perfect in Web Site, but not in Web Application)
[web.config]
....
<anonymousIdentification enabled="true"/>
<profile defaultProvider="myProfileProvider">
<providers>
<clear/>
<add name="myProfileProvider"
connectionStringName="myConnectionString"
type="System.Web.Profile.SqlProfileProvider"/>
</providers>
<properties>
<add name="FullName" defaultValue="Guest" allowAnonymous="true"/>
<add name="Birthday" type="System.DateTime" allowAnonymous="true"/>
</properties>
</profile>
....
[default.aspx.vb]
....
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then
BindFields()
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Profile.FullName = TextBox1.Text
BindFields()
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Profile.Birthday = Calendar1.SelectedDate
BindFields()
End Sub
Private Sub BindFields()
Label1.Text = Profile.FullName
Label2.Text = Profile.Birthday.ToShortDateString
End Sub
....
with the Profile classes in a sample Web Site, but cannot seem to get
the Profile to work in my actual Web Application Project. I am able to
add profile properties and/or profile inheritence to the web.config,
but IntelliSense never kicks in on any of my pages or code-behinds.
When I type Profile, it looks like I may be getting the
System.Web.Profile namespace instead of a page-level Profile
property/accessor?
Can anyone confirm that Profile works with Web Application projects and
that "Profile.MyProperty" works on pages in W.A. projects?
ex. (works perfect in Web Site, but not in Web Application)
[web.config]
....
<anonymousIdentification enabled="true"/>
<profile defaultProvider="myProfileProvider">
<providers>
<clear/>
<add name="myProfileProvider"
connectionStringName="myConnectionString"
type="System.Web.Profile.SqlProfileProvider"/>
</providers>
<properties>
<add name="FullName" defaultValue="Guest" allowAnonymous="true"/>
<add name="Birthday" type="System.DateTime" allowAnonymous="true"/>
</properties>
</profile>
....
[default.aspx.vb]
....
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then
BindFields()
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Profile.FullName = TextBox1.Text
BindFields()
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Profile.Birthday = Calendar1.SelectedDate
BindFields()
End Sub
Private Sub BindFields()
Label1.Text = Profile.FullName
Label2.Text = Profile.Birthday.ToShortDateString
End Sub
....