Mono Support Implementing another asp.net project in MonoX, need help ? 

Viewed 41768 time(s), 5 post(s), 6/2/2012 10:41:39 AM - by super
6/2/2012 10:43:26 AM
6018 Reputation 709 Total posts

I am trying to integrate Job Site Started kit in MonoX. Job Site starter kit also uses ASP.NET Membership tables so the extra job site related tables, I created in monoX database, added all the required roles of job site in MonoX. I am able to log into the job site starter kit successfully now in MonoX project.

Now on everyone's profile page, why I am getting this (please see ATTACHED image)

Time zone UTC

Employer.CompanyID 1

JobSeeker.ResumeID 0

FYI: In monoX webconfig I have this:

<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="UserName" type="System.String"/>
<add name="Email" type="System.String"/>
<add name="FirstName" type="System.String" />
<add name="LastName" type="System.String" />
<group name="JobSeeker">
<add name="ResumeID" type="System.Int32"/>
</group>
<group name="Employer">
<add name="CompanyID" type="System.Int32"/>
</group>
</properties>
 
</profile>

1
6/2/2012 10:45:11 AM
6018 Reputation 709 Total posts

Also the ASP.NET project (job starter kit) that I am trying to add in monoX has this in the registeration form so that if anyone register, he or she can make himself or herself as "Jobseeker" or "Employer".


This is the code of the registration page (which is using 2 step wizard process):

I HAVE TESTED THIS CODE IN JOB SITE STARTER KITS, IT WORKED 100%



using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
  
public partial class register_aspx : Page
{
  
    protected void CreateUserWizard1_ContinueButtonClick(object sender, EventArgs e)
    {
        Response.Redirect("/default.aspx");
    }
  
    protected void Page_Load(object sender, EventArgs e)
    {
          
    }
    protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
        if (CreateUserWizard1.ActiveStep.ID == "WizardStep2")
        {
            TextBox t = ((TextBox)CreateUserWizard1.ActiveStep.FindControl("TextBox1"));
            ViewState["firstname"]=t.Text;
            t = ((TextBox)CreateUserWizard1.ActiveStep.FindControl("TextBox2"));
            ViewState["lastname"]=t.Text;
        }
  
        if (CreateUserWizard1.ActiveStep.ID == "WizardStep1")
        {
            MembershipUser objUser = Membership.GetUser();
            DropDownList ddl = ((DropDownList)CreateUserWizard1.ActiveStep.FindControl("DropDownList1"));
            if (ddl != null)
            {
                Roles.AddUserToRole(objUser.UserName, ddl.SelectedValue);
            }
            Profile.UserName = objUser.UserName;
            Profile.Email = objUser.Email;
            Profile.FirstName=ViewState["firstname"].ToString();
            Profile.LastName=ViewState["lastname"].ToString();
            Profile.JobSeeker.ResumeID = -1;
            Profile.Employer.CompanyID = -1;
        }
    }
  
    protected void CreateUserWizard1_ActiveStepChanged(object sender, EventArgs e)
    {
        if (CreateUserWizard1.ActiveStep.ID == "WizardStep1")
        {
            DropDownList ddl = ((DropDownList)CreateUserWizard1.ActiveStep.FindControl("DropDownList1"));
            if (ddl != null)
            {
                ListItem li1 = new ListItem("Job Seeker", ConfigurationManager.AppSettings["jobseekerrolename"]);
                ListItem li2 = new ListItem("Employer", ConfigurationManager.AppSettings["employerrolename"]);
                ddl.Items.Add(li1);
                ddl.Items.Add(li2);
            }
  
        }
    }
}

2
6/2/2012 10:47:19 AM
6018 Reputation 709 Total posts

Here is the complete webconfig of job site starter kit:

<?xml version="1.0"?>
<configuration>
    <!--
  Use this section to specify custom application settings. These settings
  are used inside the code on many pages. You can modify them to suit your setup.
  -->
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections>
   
  <appSettings>
        <add key="pagetitle" value="Job Site Starter Kit (Ver. 3.5)"></add>
        <add key="sitelogo" value="logo.gif"></add>
        <add key="jobseekerrolename" value="jobseeker"></add>
        <add key="employerrolename" value="employer"></add>
        <add key="adminrolename" value="admin"></add>
        <add key="webmasteremail" value="webmaster@somesite.com"></add>
        <add key="advertiseemail" value="sales@somesite.com"></add>
    </appSettings>
    <!--
  These are the connection string used for your application specific data and
  ASP.NET provider (membership, roles etc.)
  You can change them as per your setup.
  -->
    <connectionStrings>
        <add name="connectionstring" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|JsskDb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
        <add name="MyProviderConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|JsskDb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
    <location path="changepassword.aspx">
        <system.web>
            <authorization>
                <deny users="?"/>
            </authorization>
        </system.web>
    </location>
    <system.web>
        <!--
    This is the default theme applied to the site.
    You can build your own themes and change this setting accordingly.
    -->
        <pages theme="YellowShades">
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages>
        <compilation debug="true">
       
            <assemblies>
                <add assembly="System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
 
       
     
    </compilation>
        <customErrors mode="Off" defaultRedirect="customerrorpage.aspx"></customErrors>
        <anonymousIdentification enabled="true"/>
        <authentication mode="Forms"/>
        <membership defaultProvider="MyProvider">
            <providers>
                <add connectionStringName="MyProviderConnectionString"
             applicationName="/JobSiteStarterKit"
             description=""
             requiresUniqueEmail="false"
             enablePasswordRetrieval="true"
             enablePasswordReset="false"
             requiresQuestionAndAnswer="false"
             passwordFormat="Clear"
             name="MyProvider"
             type="System.Web.Security.SqlMembershipProvider"/>
            </providers>
        </membership>
        <roleManager enabled="true" defaultProvider="MyProvider" domain="jobstarterkit">
            <providers>
                <add connectionStringName="MyProviderConnectionString" applicationName="/JobSiteStarterKit" description="" name="MyProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
            </providers>
        </roleManager>
        <profile defaultProvider="MyProvider">
            <providers>
                <add connectionStringName="MyProviderConnectionString" applicationName="/JobSiteStarterKit" description="" name="MyProvider" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
            </providers>
            <properties>
                <add name="UserName" type="System.String"/>
                <add name="Email" type="System.String"/>
                <add name="FirstName" type="System.String" allowAnonymous="true"/>
                <add name="LastName" type="System.String" allowAnonymous="true"/>
                <group name="JobSeeker">
                    <add name="ResumeID" type="System.Int32"/>
                </group>
                <group name="Employer">
                    <add name="CompanyID" type="System.Int32"/>
                </group>
            </properties>
        </profile>
        <webParts>
            <personalization defaultProvider="JSSKWebPartProvider">
                <providers>
                    <add connectionStringName="MyProviderConnectionString" name="JSSKWebPartProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider, System.Web,          Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                </providers>
            </personalization>
        </webParts>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules>
    </system.web>
    <system.net>
        <mailSettings>
            <smtp from="webmaster@somedomain.com">
                <network defaultCredentials="true" host="localhost"/>
            </smtp>
        </mailSettings>
    </system.net>
    <location path="employer">
        <system.web>
            <authorization>
                <deny users="?"/>
            </authorization>
        </system.web>
    </location>
    <location path="jobseeker">
        <system.web>
            <authorization>
                <deny users="?"/>
            </authorization>
        </system.web>
    </location>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/></compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/optioninfer+">
                <providerOption name="CompilerVersion" value="v3.5"/></compiler></compilers></system.codedom>
    <system.web.extensions>
        <scripting>
             
       
       
        </scripting>
    </system.web.extensions>
    <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0. It is not necessary for previous version of IIS.
    -->
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer>
 
</configuration>

3
6/2/2012 10:47:55 AM
6018 Reputation 709 Total posts

If anytime you would like to test it, you can download the ASP.NET 3.5 Job site starter kit from here: http://www.asp.net/downloads/starter-kits/job

4
6/4/2012 7:23:07 PM
15993 Reputation 2214 Total posts

Hi,

can you please try and set the following:

<group name="JobSeeker">
    <add name="ResumeID" type="System.Int32"/>
</group>
<group name="Employer">
    <add name="CompanyID" type="System.Int32"/>
</group>

From System.Int32 to just int so we can see if this is MonoX bug or not ?

Regards

5
This is a demo site for MonoX. Please visit Mono Software for more info.