Hello,
I was trying to add custum field to profile on (MonoX_4_0_2650_40.zip 19.32 MB)
http://www.mono-software.com/Downloads/#MonoX
<
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
=
"Teachers"
type
=
"string"
/>
</
properties
>
</
profile
>
I have error
The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)
I copy "ProjectName.sln" to root folder and add ProfileCommon class( from http://msdn.microsoft.com/en-us/library/aa983476.aspx#Y3888).
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.Profile;
public class ProfileCommon : ProfileBase
{
[SettingsAllowAnonymous(false)]
[ProfileProvider("AspNetSqlProfileProvider")]
public string Teachers
{
get
{
if (this.GetPropertyValue("Teachers") == null) return string.Empty;
else return (string)this.GetPropertyValue("Teachers");
}
set
{
this.SetPropertyValue("Teachers", value);
}
}
}
There is other error
System.ArgumentNullException: Value cannot be null.
Parameter name: type
I doing something wrong?
Thanks,
Andrey.