CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 5/9/2007 11:58:17 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 0 Views: 68 Favorited: 0 Favorite
1 Items, 1 Pages 1 |< << Go >> >|
saintperez
Asp.Net User
Unable to cast object of type 'ProfileCommon' to type 'ProfileCommon' with custom ProfileProvider5/9/2007 11:58:17 AM

0

I have a fairly simple test right now and am comming across this error when ever I add a property of type 'Person' (Custom Class). I have a nother property of type Vendor that has no problem when I run the app with just this property. As soon as I add the Person Property I get the Error. One thing that I noticed is that ProfileProvider Intialize event gets triggered when I have the Person property and not when I have just the Vendor property. Any ideas would be appreciated.

<

profile defaultProvider="GlobalProfileProvider" enabled="true" >

<providers>

<add applicationName="ProfileProviderTest" name="GlobalProfileProvider" type="ProjectCentral.ProfileProvider.Profile" />

</providers>

<properties>

<add name="Person" type="ProjectCentral.Contacts.Person" />

<add name="Vendor" type="ProjectCentral.Vendors.Vendor" />

<add name="BGColor" type="string"/>

<add name="TEST" type="string" />

</properties>

</profile>

 

 

 Test Page:

protected void Page_Load(object sender, EventArgs e)

{

Profile.Context.Remove("UserName");

Profile.Context.Add(

"UserName", "[email protected]");

Profile.Context.Add(

"vendorid", 162738);

Profile.Context.Add(

"vendorsearchdetail", Vendor_abs.eSearchDetail.Vendor_NameOnly);

}

 

 

Profile Provider:

public sealed class Profile :System.Web.Profile.ProfileProvider

{

#region

attributes

private string _AppName = "";

const string _Err_AppNameMissing = "ProfileProvider requires application name to be set prior to calling this function.";

const string _Err_UserNameMissing = "ProfileProvider requires user name in the context param.";

const string _Err_VendorIDMissing = "ProfileProvider requires a VendorID as part of the context when requesting a vendor.";

const string _Err_ConfigMissing = "ProfileProvider requires correct setting in configuration file.";

#endregion

public override string ApplicationName

{

get

{

return this._AppName;

}

set

{

this._AppName = value;

}

}

public override void Initialize(string name, NameValueCollection config)

{

if (config == null)

throw new ArgumentNullException("config");

this.ApplicationName = (string)config["applicationName"];

 

base.Initialize(name, config);

}


Santiago Perez
Systems Architect

Florida's Turnpike Enterprise
1 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Unable to cast object of type 'ProfileCommon' to type ... Unable to cast object of type 'ProfileCommon' to type 'ProfileCommon' with custom ProfileProvider. Last post 05-09-2007 7:58 AM by saintperez. 0 replies. ...
Unable to cast object of type 'ProfileCommon' to type ... Unable to cast object of type 'ProfileCommon' to type 'ProfileCommon' ... I was trying to read a custom property off of the profile object. ...
Unable to cast object of type 'ProfileCommon' to type ... Jul 4, 2008 ... ASP.NET Web Applications: Security , Profile Provider , Profile. Unable to cast object of type 'ProfileCommon' to type 'ProfileCommon' ... you may need to create a custom profile class to define your profile properties. ...
Implementing Profile Provider in ASP.NET MVC - Stack Overflow Create() cannot cast to type ProfileCommon, so I'm not able to get back my profile .... I have been unable to locate an answer for this and I'm skeptical of whether or not it's a bug in ASP. ... How to implement a custom cache provider with ASP.NET MVC ... Accessing the Profile object from Code Behind Bug? (ASP. ...
Problem: Can't get the Sql Table Profile Provider to work with YAF ... Unable to cast object of type 'ProfileCommon' to type 'YAF. ... YAF profile class uses "custom data" and it's not compatible with SQL Table ...

Unable to cast object of type 'System.Web.Profile.DefaultProfile ... Note that the profile object is strongly typed – which means profile ...... Unable to cast System.Web.Profile.DefaultProfile to type ProfileCommon. ...
Convert a user control, so that it can be used as a web part. - ng ... unable to cast object of type 'profilecommon' to type 'profilecommon' with custom profileprovider · how can i reflect changes to all the user's settings ...






profile ...counting hits

profile

change window title in crm

webpartzone, gridview, objectdatasorce, datalist

how can i add custom verb for web parts

is there a personalization provider sample?

localizing an application in the master page

communication between usercontrol and webpart

how to use web part catalogue?

webpart for text changes in a simple cms

help using membership object

user management within webparts

strange personalization question

problem with dynamically creating webparts

error when i drag and drop the webpartmanager

how to pass string variable from web part to website using query string?

webpart is not stable?

problem using web parts

grid in web part zone when expand or minimize

deploying web parts to moss 2007

disable dropping on webpartzone

custom control overlaps web-part title

personalization will timeout after idle?

ihttphandlers, virtual urls, and a pesky bug i can't find...

pagecatalogpart - is not working

exporting webpart descriptions - issensitive bug?

using flash in web part

implementing custom provider - problem with username

wrapping user controls

link button click event

   
  Privacy | Contact Us
All Times Are GMT