By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Does anyone have ASP.Net 2.0 Profiles working in a Web Application Project?

P: n/a
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
....

Oct 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hey Nathan,

I was exactly looking for the same thing today. Here is some
information, that might help you.

http://www.gotdotnet.com/workspaces/...c-b4f135df4127

Thanks,
Raj

na************@gmail.com wrote:
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
...
Oct 4 '06 #2

P: n/a
So is this a confirmed (by MS? by users?) known problem in VS05? Is
this something MS is working on? (say, maybe, VS05 SP1?)

Am I just using an out of date version of the Web Application Project
addons? How can I tell which version I have?

Rajesh wrote:
Hey Nathan,

I was exactly looking for the same thing today. Here is some
information, that might help you.

http://www.gotdotnet.com/workspaces/...c-b4f135df4127

Thanks,
Raj

na************@gmail.com wrote:
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
...
Oct 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.