Mono Support Custom Profiles. Multiple Types.. (Closed)

Viewed 39063 time(s), 11 post(s), 3/7/2011 3:30:49 PM - by shawndg
3/7/2011 3:30:49 PM
1871 Reputation 252 Total posts

Hello, figured I would move this into its own thread...

I have a need for multiple profile types and I'm having a hard time trying to figure it out.

So far I have been unable to create my own custom page.. I spent a couple hours trying to figure it out but I dont know enough about monox and I dont think I am going about it the correct way...

I found some example code somewhere in the forums.. and started working from that but I had multiple issues trying to get it to work.. and It did not solve the initial problem..

I need multiple profile pages / profile types.. I would just like to start with two profile types and then move forward from there... But I dont think I know enough about Monox to understand how to do this just yet..

I tried created a customized ProfilePage and placing the needed controls on it for profiles but I did not do very well.. as there a lot of stuff going on I dont understand and I had a hell of a time just trying to get it to compile.

Is there anyway.. we can get maybe a example of how to create custom profile pages in Monox ? as I can see a need for this in multiple projects and that could become a pretty common request.. Would be greatly appreciated! as its the one thing really holding back my project.

1
3/7/2011 5:43:07 PM
7207 Reputation 956 Total posts

Hi Shawn,
The source code sample should be ready for you tomorrow.

2
3/8/2011 12:41:40 PM
15993 Reputation 2214 Total posts

Hi,

the source code sample that we promised is in the attachment. This is only a source code part of the sample we will post a small tutorial regarding the sample soon.

I hope you can find this sample helpful. 

Regards

3
3/8/2011 12:44:20 PM
15993 Reputation 2214 Total posts

One more thing that i forgot to mention is that you need to copy the MonoX  (the whole downloaded package) to the same folder as sample to be able to compile the sample in Visual Studio. If you already have a working copy MonoX on your machine you may copy the web.config to this example root after you copy the whole project so you can skip the installation process.

Regards

4
3/15/2011 3:27:09 PM
15993 Reputation 2214 Total posts

Hi,

sorry for the delay, here is a small tutorial on extending MonoX profile. If you have any other question please post them as a new topic.

Regards.

5
3/22/2011 7:25:43 PM
1871 Reputation 252 Total posts

Hi,

I cant get the sample to compile..

I started a whole new project.. and set it up to .net 3.5..

I having problems related to the custom properties... i think has something to do with the default ASP.NET profile infrastructure..

I dont plan to use that.. but I am just trying to get it to compile to get some example code up and running and move forward from there..

6
3/23/2011 7:39:48 AM
15993 Reputation 2214 Total posts

Hi,

an you provide us with the error you get so we can check the issue you are facing ?

Regards.

7
4/2/2011 1:28:07 AM
1871 Reputation 252 Total posts

something to do with the .net profiles..

Error 1 'MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PeopleSearch' does not contain a definition for 'GetInvitationSentVisibility' and no extension method 'GetInvitationSentVisibility' accepting a first argument of type 'MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PeopleSearch' could be found (are you missing a using directive or an assembly reference?) C:\MonoxProfile\ProjectName\ProfileSamples\MonoXProfileTemplates\MonoXProfileSample.aspx.cs 104 80 Portal
Error 3 'MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PeopleSearch' does not contain a definition for 'GetInvitationSentVisibility' and no extension method 'GetInvitationSentVisibility' accepting a first argument of type 'MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PeopleSearch' could be found (are you missing a using directive or an assembly reference?) C:\MonoxProfile\ProjectName\ProfileSamples\ASPNETProfileSample\ASPNETProfileSample.aspx.cs 100 80 Portal
Error 2 'MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PeopleSearch' does not contain a definition for 'GetInvitationReceivedVisibility' and no extension method 'GetInvitationReceivedVisibility' accepting a first argument of type 'MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PeopleSearch' could be found (are you missing a using directive or an assembly reference?) C:\MonoxProfile\ProjectName\ProfileSamples\MonoXProfileTemplates\MonoXProfileSample.aspx.cs 104 128 Portal
Error 4 'MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PeopleSearch' does not contain a definition for 'GetInvitationReceivedVisibility' and no extension method 'GetInvitationReceivedVisibility' accepting a first argument of type 'MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PeopleSearch' could be found (are you missing a using directive or an assembly reference?) C:\MonoxProfile\ProjectName\ProfileSamples\ASPNETProfileSample\ASPNETProfileSample.aspx.cs 100 128 Portal

8
4/2/2011 2:24:47 AM
1871 Reputation 252 Total posts

Ok..

I went into the web config - and commented out the first part and then uncommented support for web profiles..


<!-- Asp.Net compiles the profile to the App_Code.dll which can't be shiped with the MonoX CMS because custom projects needs to have ability of having custom code put in to the Asp.net folder App_Code (which is compile it to the App_Code.dll) -->
    <!--"System.Collections.Specialized.StringCollection" type is added to show that complex types are ignored for now-->
    <!--<profile enabled="true" defaultProvider="AspNetSqlProfileProvider">
        <providers>
            <remove name="AspNetSqlProfileProvider"/>
            <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="MonoX" type="System.Web.Profile.SqlProfileProvider"/>
        </providers>
        <properties>
        </properties>
    </profile>-->
    <!--ENABLE CUSTOM USER PROFILE FILEDS-->
    <profile enabled="true" defaultProvider="AspNetSqlProfileProvider">
        <providers>
            <remove name="AspNetSqlProfileProvider"/>
            <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="MonoX" type="System.Web.Profile.SqlProfileProvider"/>
        </providers>
        <properties>
            <add name="GPSLocation" defaultValue="45.562141,18.676414"/>
            <add name="Children"/>
            <add name="RecentSearchList" type="System.Collections.Specialized.StringCollection" serializeAs="Xml"/>
            <add name="Hometown" type="String" serializeAs="String"/>
            <add name="IsModerator" type="bool"/>
            <group name="Bio">
                <add name="Title" type="string"/>
                <add name="Description" type="String"/>
            </group>
            <group name="Publication">
                <add name="Title" type="string"/>
                <add name="Description" type="String"/>
                <add name="Date" type="DateTime"/>
            </group>
            <add name="ClubJoinedYear" type="int"/>
            <add name="MoneyDonated" type="decimal"/>
        </properties>
    </profile>



now I got new error..

Compilation Error

Description: An error occurred during the
compilation of a resource required to service this request. Please
review the following specific error details and modify your source code
appropriately.

Compiler Error Message: CS0246: The type or
namespace name 'ProfileCommon' could not be found (are you missing a
using directive or an assembly reference?)

Source Error:

Line 119: }
Line 120:
Line 121: protected ProfileCommon Profile {
Line 122: get {
Line 123: return ((ProfileCommon)(this.Context.Profile));

I think they may be related..
Note in using .net 3.5 and vs 2010 .

9
4/2/2011 3:25:07 AM
1871 Reputation 252 Total posts

Ok..

I got it up and running by removing the ref to the .net profile crap... dont want it any ways.. because its not that good.. much better to do my own database connectivity so that way I can query my database much easier.. and rem it all out inside the web conf

so.. i just commented out the code and replaced it with always visible..

//snPeopleSearch.Visible = IsPeopleSearchVisible() || snPeopleSearch.GetInvitationSentVisibility() || snPeopleSearch.GetInvitationReceivedVisibility();
snPeopleSearch.Visible = true;

I also... made it so i can now access my pages.. for example..
http://localhost/MonoxProfile/mycusprofile1/Anne/ will load the profile of anne and http://localhost/MonoxProfile/mycusprofile1/admin/ will load my profile up for edit!

Below is a example of what you need to add to the web config to support the new profile page..
the tutorial does not mention this.. but its almost a req when dealing with custom profiles..

<!-- my custom profile ProjectName\ProfileSamples -->
  <set property="MyCusProfilePages" value="/ProjectName/ProfileSamples/"/>
  <rewrite url="^(.*)/mycusprofile1/(.*)/(\?(.+))?$" to="$1${MyCusProfilePages}/MonoXProfileTemplates/MonoXProfileSample.aspx?UserName=$2&$4" name="mycusprofile1" urlPattern="/mycusprofile1/{UserNameUrlEncoded}/"/>

As always.. great job Monox team!

10
1 2
This is a demo site for MonoX. Please visit Mono Software for more info.