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

Discussion in 'ASP .Net' started by nathan.haywood@gmail.com, Oct 4, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Rajesh Guest

    Hey Nathan,

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

    http://www.gotdotnet.com/workspaces/workspace.aspx?id=406eefba-2dd9-4d80-a48c-b4f135df4127

    Thanks,
    Raj

    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
    > ...
    Rajesh, Oct 4, 2006
    #2
    1. Advertising

  3. Guest

    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/workspace.aspx?id=406eefba-2dd9-4d80-a48c-b4f135df4127
    >
    > Thanks,
    > Raj
    >
    > 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, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    362
    Guest
    Aug 24, 2006
  2. =?Utf-8?B?U2hlbQ==?=

    ASP NET Profiles and Application Scope

    =?Utf-8?B?U2hlbQ==?=, Nov 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    499
    =?Utf-8?B?U2hlbQ==?=
    Nov 8, 2006
  3. charlisa
    Replies:
    1
    Views:
    109
    Bob Barrows [MVP]
    Oct 16, 2008
  4. Nick Brown
    Replies:
    6
    Views:
    127
    Michael Guterl
    Aug 3, 2009
  5. Ronald
    Replies:
    0
    Views:
    109
    Ronald
    Jun 26, 2007
Loading...

Share This Page