<profile><properties> with no Profile class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven

    #1

    <profile><properties> with no Profile class

    I have the following in my web.config:
    <system.web>
    <profile defaultProvider ="MyASPSqlProfi leProvider" enabled="true" >
    <properties>
    <add name="FirstName " defaultValue="" type="string"/>
    <add name="MiddleIni tial" defaultValue="" type="string" />
    <add name="LastName" defaultValue="" type="string"/>
    <add name="Address1" defaultValue="" type="string"/>
    <add name="Address2" defaultValue="" type="string"/>
    <add name="City" defaultValue="" type="string"/>
    <add name="State" defaultValue=""/>
    <add name="Country" defaultValue="" type="string"/>
    <add name="PostalCod e" defaultValue="" type="string"/>
    <add name="Phone" defaultValue="" type="string"/>
    <add name="NewsLette rOK" defaultValue="t rue" type="bool"/>
    <add name="LastOrder " defaultValue="" type="System.Da teTime"/>
    </properties>
    </profile>

    When I compile, I don't get a Profile class. If I try to use it anyway
    I get compiler errors. What am I doing wrong?

    Using VS2008.

    Every site I visit says you simple add <profilewith some properties
    and VS will generate the Profile class for you.

    Thanks,

    Steven





  • Gregory A. Beamer \(Cowboy\) - MVP

    #2
    Re: &lt;profile&gt; &lt;properties& gt; with no Profile class

    First, I must say I am not particularly fond of the default implementation
    of Profile. It is simple, but it is a tight box to fit into. It also errors
    out and forces you to play games with Temporary ASP.NET files at times, but
    deleting them generally clears things up.

    At first blush, the config looks fine. What code are you using to try to
    pull the ProfileCommon object?

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog


    or just read it:


    *************** *************** **************
    | Think outside the box! |
    *************** *************** **************
    "Steven" <sedison@protro nix_nospam_.com wrote in message
    news:%23KIpoA8M JHA.4380@TK2MSF TNGP04.phx.gbl. ..
    >I have the following in my web.config:
    <system.web>
    <profile defaultProvider ="MyASPSqlProfi leProvider" enabled="true" >
    <properties>
    <add name="FirstName " defaultValue="" type="string"/>
    <add name="MiddleIni tial" defaultValue="" type="string" />
    <add name="LastName" defaultValue="" type="string"/>
    <add name="Address1" defaultValue="" type="string"/>
    <add name="Address2" defaultValue="" type="string"/>
    <add name="City" defaultValue="" type="string"/>
    <add name="State" defaultValue=""/>
    <add name="Country" defaultValue="" type="string"/>
    <add name="PostalCod e" defaultValue="" type="string"/>
    <add name="Phone" defaultValue="" type="string"/>
    <add name="NewsLette rOK" defaultValue="t rue" type="bool"/>
    <add name="LastOrder " defaultValue="" type="System.Da teTime"/>
    </properties>
    </profile>
    >
    When I compile, I don't get a Profile class. If I try to use it anyway
    I get compiler errors. What am I doing wrong?
    >
    Using VS2008.
    >
    Every site I visit says you simple add <profilewith some properties
    and VS will generate the Profile class for you.
    >
    Thanks,
    >
    Steven
    >
    >
    >
    >
    >

    Comment

    • EdisonCPP

      #3
      Re: &lt;profile&gt; &lt;properties& gt; with no Profile class

      I can't even do:
      Profile.Anythin g

      I just want to add a couple of fields to the default user information
      in the database using CreateUserWizar d and the Login control.

      I wanted to assign the values in CreateUserWizar d::CreatedUser( ) and
      save them to the database.

      I was under the impression I could do something like:
      Profile.FirstNa me = txtFirstName.Te xt;
      Profile.Save();

      But I get no intellisense with Profile. and anything I try to do with it
      says it doesn't exist.

      I can do:
      HttpContext.Cur rent.Profile
      but my new fields aren't in that instance.

      Have I mis-interpreted something, or just done something wrong?

      Thanks again!

      Steven

      "Gregory A. Beamer (Cowboy) - MVP" <NoSpamMgbworld @comcast.netNoS pamMwrote
      in message news:%23YZyFcUN JHA.4440@TK2MSF TNGP06.phx.gbl. ..
      First, I must say I am not particularly fond of the default implementation
      of Profile. It is simple, but it is a tight box to fit into. It also
      errors out and forces you to play games with Temporary ASP.NET files at
      times, but deleting them generally clears things up.
      >
      At first blush, the config looks fine. What code are you using to try to
      pull the ProfileCommon object?
      >
      --
      Gregory A. Beamer
      MVP, MCP: +I, SE, SD, DBA
      >
      Subscribe to my blog

      >
      or just read it:

      >
      *************** *************** **************
      | Think outside the box! |
      *************** *************** **************
      "Steven" <sedison@protro nix_nospam_.com wrote in message
      news:%23KIpoA8M JHA.4380@TK2MSF TNGP04.phx.gbl. ..
      >>I have the following in my web.config:
      ><system.web>
      ><profile defaultProvider ="MyASPSqlProfi leProvider" enabled="true" >
      > <properties>
      > <add name="FirstName " defaultValue="" type="string"/>
      > <add name="MiddleIni tial" defaultValue="" type="string" />
      > <add name="LastName" defaultValue="" type="string"/>
      > <add name="Address1" defaultValue="" type="string"/>
      > <add name="Address2" defaultValue="" type="string"/>
      > <add name="City" defaultValue="" type="string"/>
      > <add name="State" defaultValue=""/>
      > <add name="Country" defaultValue="" type="string"/>
      > <add name="PostalCod e" defaultValue="" type="string"/>
      > <add name="Phone" defaultValue="" type="string"/>
      > <add name="NewsLette rOK" defaultValue="t rue" type="bool"/>
      > <add name="LastOrder " defaultValue="" type="System.Da teTime"/>
      > </properties>
      ></profile>
      >>
      >When I compile, I don't get a Profile class. If I try to use it anyway
      >I get compiler errors. What am I doing wrong?
      >>
      >Using VS2008.
      >>
      >Every site I visit says you simple add <profilewith some properties
      >and VS will generate the Profile class for you.
      >>
      >Thanks,
      >>
      >Steven
      >>
      >>
      >>
      >>
      >>
      >
      >

      Comment

      • Gregory A. Beamer \(Cowboy\) - MVP

        #4
        Re: &lt;profile&gt; &lt;properties& gt; with no Profile class

        The class that holds the autogen stuff is called ProfileCommon, not Profile.
        Not sure why, but I have not looked at what is going on. You use it like
        this:

        ProfileCommon profile = (ProfileCommon) ProfileCommon.C reate("UserName Here",
        true);

        You can then get at the custom profile elements you have created.

        --
        Gregory A. Beamer
        MVP, MCP: +I, SE, SD, DBA

        Subscribe to my blog


        or just read it:


        *************** *************** **************
        | Think outside the box! |
        *************** *************** **************
        "EdisonCPP" <EdisonCPP@news groups.nospamwr ote in message
        news:erdJMaWNJH A.4600@TK2MSFTN GP06.phx.gbl...
        >I can't even do:
        Profile.Anythin g
        >
        I just want to add a couple of fields to the default user information
        in the database using CreateUserWizar d and the Login control.
        >
        I wanted to assign the values in CreateUserWizar d::CreatedUser( ) and
        save them to the database.
        >
        I was under the impression I could do something like:
        Profile.FirstNa me = txtFirstName.Te xt;
        Profile.Save();
        >
        But I get no intellisense with Profile. and anything I try to do with it
        says it doesn't exist.
        >
        I can do:
        HttpContext.Cur rent.Profile
        but my new fields aren't in that instance.
        >
        Have I mis-interpreted something, or just done something wrong?
        >
        Thanks again!
        >
        Steven
        >
        "Gregory A. Beamer (Cowboy) - MVP" <NoSpamMgbworld @comcast.netNoS pamM>
        wrote in message news:%23YZyFcUN JHA.4440@TK2MSF TNGP06.phx.gbl. ..
        >First, I must say I am not particularly fond of the default
        >implementati on of Profile. It is simple, but it is a tight box to fit
        >into. It also errors out and forces you to play games with Temporary
        >ASP.NET files at times, but deleting them generally clears things up.
        >>
        >At first blush, the config looks fine. What code are you using to try to
        >pull the ProfileCommon object?
        >>
        >--
        >Gregory A. Beamer
        >MVP, MCP: +I, SE, SD, DBA
        >>
        >Subscribe to my blog
        >http://feeds.feedburner.com/GregoryBeamer#
        >>
        >or just read it:
        >http://feeds.feedburner.com/GregoryBeamer
        >>
        >************** *************** ***************
        >| Think outside the box! |
        >************** *************** ***************
        >"Steven" <sedison@protro nix_nospam_.com wrote in message
        >news:%23KIpoA8 MJHA.4380@TK2MS FTNGP04.phx.gbl ...
        >>>I have the following in my web.config:
        >><system.web >
        >><profile defaultProvider ="MyASPSqlProfi leProvider" enabled="true" >
        >> <properties>
        >> <add name="FirstName " defaultValue="" type="string"/>
        >> <add name="MiddleIni tial" defaultValue="" type="string" />
        >> <add name="LastName" defaultValue="" type="string"/>
        >> <add name="Address1" defaultValue="" type="string"/>
        >> <add name="Address2" defaultValue="" type="string"/>
        >> <add name="City" defaultValue="" type="string"/>
        >> <add name="State" defaultValue=""/>
        >> <add name="Country" defaultValue="" type="string"/>
        >> <add name="PostalCod e" defaultValue="" type="string"/>
        >> <add name="Phone" defaultValue="" type="string"/>
        >> <add name="NewsLette rOK" defaultValue="t rue" type="bool"/>
        >> <add name="LastOrder " defaultValue="" type="System.Da teTime"/>
        >> </properties>
        >></profile>
        >>>
        >>When I compile, I don't get a Profile class. If I try to use it anyway
        >>I get compiler errors. What am I doing wrong?
        >>>
        >>Using VS2008.
        >>>
        >>Every site I visit says you simple add <profilewith some properties
        >>and VS will generate the Profile class for you.
        >>>
        >>Thanks,
        >>>
        >>Steven
        >>>
        >>>
        >>>
        >>>
        >>>
        >>
        >>
        >
        >

        Comment

        • Steven

          #5
          Re: &lt;profile&gt; &lt;properties& gt; with no Profile class

          It's so odd. I found my temporary files, and the cs files have
          the:

          protected ProfileCommon Profile {
          get {
          return ((ProfileCommon )(this.Context. Profile));
          }
          }
          for each of my files.

          And the class ProfileCommon definition file, yet in my project
          I can't seem to use ProfileCommon or Profile. They're not
          in my autocomplete, and they won't compile. The ProfileCommon
          definition file matches my web.config prefectly.

          Can I just delete my temporary files and recompile?

          Steven

          "Gregory A. Beamer (Cowboy) - MVP" <NoSpamMgbworld @comcast.netNoS pamMwrote
          in message news:uK8Gv6fNJH A.3476@TK2MSFTN GP05.phx.gbl...
          The class that holds the autogen stuff is called ProfileCommon, not
          Profile. Not sure why, but I have not looked at what is going on. You use
          it like this:
          >
          ProfileCommon profile =
          (ProfileCommon) ProfileCommon.C reate("UserName Here", true);
          >
          You can then get at the custom profile elements you have created.
          >
          --
          Gregory A. Beamer
          MVP, MCP: +I, SE, SD, DBA
          >
          Subscribe to my blog

          >
          or just read it:

          >
          *************** *************** **************
          | Think outside the box! |
          *************** *************** **************
          "EdisonCPP" <EdisonCPP@news groups.nospamwr ote in message
          news:erdJMaWNJH A.4600@TK2MSFTN GP06.phx.gbl...
          >>I can't even do:
          >Profile.Anythi ng
          >>
          >I just want to add a couple of fields to the default user information
          >in the database using CreateUserWizar d and the Login control.
          >>
          >I wanted to assign the values in CreateUserWizar d::CreatedUser( ) and
          >save them to the database.
          >>
          >I was under the impression I could do something like:
          >Profile.FirstN ame = txtFirstName.Te xt;
          >Profile.Save() ;
          >>
          >But I get no intellisense with Profile. and anything I try to do with it
          >says it doesn't exist.
          >>
          >I can do:
          >HttpContext.Cu rrent.Profile
          >but my new fields aren't in that instance.
          >>
          >Have I mis-interpreted something, or just done something wrong?
          >>
          >Thanks again!
          >>
          >Steven
          >>
          >"Gregory A. Beamer (Cowboy) - MVP" <NoSpamMgbworld @comcast.netNoS pamM>
          >wrote in message news:%23YZyFcUN JHA.4440@TK2MSF TNGP06.phx.gbl. ..
          >>First, I must say I am not particularly fond of the default
          >>implementatio n of Profile. It is simple, but it is a tight box to fit
          >>into. It also errors out and forces you to play games with Temporary
          >>ASP.NET files at times, but deleting them generally clears things up.
          >>>
          >>At first blush, the config looks fine. What code are you using to try to
          >>pull the ProfileCommon object?
          >>>
          >>--
          >>Gregory A. Beamer
          >>MVP, MCP: +I, SE, SD, DBA
          >>>
          >>Subscribe to my blog
          >>http://feeds.feedburner.com/GregoryBeamer#
          >>>
          >>or just read it:
          >>http://feeds.feedburner.com/GregoryBeamer
          >>>
          >>************* *************** *************** *
          >>| Think outside the box! |
          >>************* *************** *************** *
          >>"Steven" <sedison@protro nix_nospam_.com wrote in message
          >>news:%23KIpoA 8MJHA.4380@TK2M SFTNGP04.phx.gb l...
          >>>>I have the following in my web.config:
          >>><system.we b>
          >>><profile defaultProvider ="MyASPSqlProfi leProvider" enabled="true" >
          >>> <properties>
          >>> <add name="FirstName " defaultValue="" type="string"/>
          >>> <add name="MiddleIni tial" defaultValue="" type="string" />
          >>> <add name="LastName" defaultValue="" type="string"/>
          >>> <add name="Address1" defaultValue="" type="string"/>
          >>> <add name="Address2" defaultValue="" type="string"/>
          >>> <add name="City" defaultValue="" type="string"/>
          >>> <add name="State" defaultValue=""/>
          >>> <add name="Country" defaultValue="" type="string"/>
          >>> <add name="PostalCod e" defaultValue="" type="string"/>
          >>> <add name="Phone" defaultValue="" type="string"/>
          >>> <add name="NewsLette rOK" defaultValue="t rue" type="bool"/>
          >>> <add name="LastOrder " defaultValue="" type="System.Da teTime"/>
          >>> </properties>
          >>></profile>
          >>>>
          >>>When I compile, I don't get a Profile class. If I try to use it anyway
          >>>I get compiler errors. What am I doing wrong?
          >>>>
          >>>Using VS2008.
          >>>>
          >>>Every site I visit says you simple add <profilewith some properties
          >>>and VS will generate the Profile class for you.
          >>>>
          >>>Thanks,
          >>>>
          >>>Steven
          >>>>
          >>>>
          >>>>
          >>>>
          >>>>
          >>>
          >>>
          >>
          >>
          >
          >

          Comment

          • Steven

            #6
            Re: &lt;profile&gt; &lt;properties& gt; with no Profile class

            I deleted my temporary files and recompiled. Still no luck.


            "Gregory A. Beamer (Cowboy) - MVP" <NoSpamMgbworld @comcast.netNoS pamMwrote
            in message news:uK8Gv6fNJH A.3476@TK2MSFTN GP05.phx.gbl...
            The class that holds the autogen stuff is called ProfileCommon, not
            Profile. Not sure why, but I have not looked at what is going on. You use
            it like this:
            >
            ProfileCommon profile =
            (ProfileCommon) ProfileCommon.C reate("UserName Here", true);
            >
            You can then get at the custom profile elements you have created.
            >
            --
            Gregory A. Beamer
            MVP, MCP: +I, SE, SD, DBA
            >
            Subscribe to my blog

            >
            or just read it:

            >
            *************** *************** **************
            | Think outside the box! |
            *************** *************** **************
            "EdisonCPP" <EdisonCPP@news groups.nospamwr ote in message
            news:erdJMaWNJH A.4600@TK2MSFTN GP06.phx.gbl...
            >>I can't even do:
            >Profile.Anythi ng
            >>
            >I just want to add a couple of fields to the default user information
            >in the database using CreateUserWizar d and the Login control.
            >>
            >I wanted to assign the values in CreateUserWizar d::CreatedUser( ) and
            >save them to the database.
            >>
            >I was under the impression I could do something like:
            >Profile.FirstN ame = txtFirstName.Te xt;
            >Profile.Save() ;
            >>
            >But I get no intellisense with Profile. and anything I try to do with it
            >says it doesn't exist.
            >>
            >I can do:
            >HttpContext.Cu rrent.Profile
            >but my new fields aren't in that instance.
            >>
            >Have I mis-interpreted something, or just done something wrong?
            >>
            >Thanks again!
            >>
            >Steven
            >>
            >"Gregory A. Beamer (Cowboy) - MVP" <NoSpamMgbworld @comcast.netNoS pamM>
            >wrote in message news:%23YZyFcUN JHA.4440@TK2MSF TNGP06.phx.gbl. ..
            >>First, I must say I am not particularly fond of the default
            >>implementatio n of Profile. It is simple, but it is a tight box to fit
            >>into. It also errors out and forces you to play games with Temporary
            >>ASP.NET files at times, but deleting them generally clears things up.
            >>>
            >>At first blush, the config looks fine. What code are you using to try to
            >>pull the ProfileCommon object?
            >>>
            >>--
            >>Gregory A. Beamer
            >>MVP, MCP: +I, SE, SD, DBA
            >>>
            >>Subscribe to my blog
            >>http://feeds.feedburner.com/GregoryBeamer#
            >>>
            >>or just read it:
            >>http://feeds.feedburner.com/GregoryBeamer
            >>>
            >>************* *************** *************** *
            >>| Think outside the box! |
            >>************* *************** *************** *
            >>"Steven" <sedison@protro nix_nospam_.com wrote in message
            >>news:%23KIpoA 8MJHA.4380@TK2M SFTNGP04.phx.gb l...
            >>>>I have the following in my web.config:
            >>><system.we b>
            >>><profile defaultProvider ="MyASPSqlProfi leProvider" enabled="true" >
            >>> <properties>
            >>> <add name="FirstName " defaultValue="" type="string"/>
            >>> <add name="MiddleIni tial" defaultValue="" type="string" />
            >>> <add name="LastName" defaultValue="" type="string"/>
            >>> <add name="Address1" defaultValue="" type="string"/>
            >>> <add name="Address2" defaultValue="" type="string"/>
            >>> <add name="City" defaultValue="" type="string"/>
            >>> <add name="State" defaultValue=""/>
            >>> <add name="Country" defaultValue="" type="string"/>
            >>> <add name="PostalCod e" defaultValue="" type="string"/>
            >>> <add name="Phone" defaultValue="" type="string"/>
            >>> <add name="NewsLette rOK" defaultValue="t rue" type="bool"/>
            >>> <add name="LastOrder " defaultValue="" type="System.Da teTime"/>
            >>> </properties>
            >>></profile>
            >>>>
            >>>When I compile, I don't get a Profile class. If I try to use it anyway
            >>>I get compiler errors. What am I doing wrong?
            >>>>
            >>>Using VS2008.
            >>>>
            >>>Every site I visit says you simple add <profilewith some properties
            >>>and VS will generate the Profile class for you.
            >>>>
            >>>Thanks,
            >>>>
            >>>Steven
            >>>>
            >>>>
            >>>>
            >>>>
            >>>>
            >>>
            >>>
            >>
            >>
            >
            >

            Comment

            Working...