+ Reply to Thread
Results 1 to 4 of 4
Thread: Problem with custom profiles
-
02-27-2008 05:22 AM #1richardt Guest
Problem with custom profiles
Hi, I've got a weird problem...
I've added two custom profile fields. When I specify the values through the web user interface, I have no problems. However, when I specify them through the UserManagementWebService, and then try to view the users in Checkbox, I get an error
In the tables, the values *seem* to be set correctly;Code:An application error occurred. Error Message: Unable to cast object of type 'System.Int32' to type 'System.String'. Source: App_Web_edituser.aspx.70ab9a11 Target Site: Void LoadCustomUserInfo() URL: http://survey.education.co.uk/Users/EditUser.aspx Referrer: http://survey.education.co.uk/Users/ManageUsers.aspx?userCreated=true User Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506) User Host Name 192.168.1.41 User Host Address 192.168.1.41 Stack Trace: at CheckboxWeb.Users.EditUser.LoadCustomUserInfo() at CheckboxWeb.Users.EditUser.LoadUserProfile() at CheckboxWeb.Users.EditUser.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at CheckboxWeb.AuthPage.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
ckbx_CustomUserField
ckbx_CustomUserFieldMapCode:CustomUserFieldID CustomUserFieldName Position IsDeletable Hidden 2 ContactID 2 0 0 3 EducationNumber 3 1 0 1 Email 1 0 0
Users jamesb & test shows fine - the others do not (both were entered manually into checkbox).Code:UniqueIdentifier CustomUserFieldID Value jamesb 1 jamesb@education.co.uk tapmantwo@hotmail.com 2 C99 tapmantwo@hotmail.com 3 123 jamesb 3 123 jamesb 2 C99 tapmantwo@hotmail.com 1 jamesb@education.co.uk richard.tappenden@btopenworld.com 2 C232 richard.tappenden@btopenworld.com 3 325897 richard.tappenden@btopenworld.com 1 richard.tappenden@btopenworld.com test 2 c1 test 3 012 test 1 a@b.c
I can't see any other differences?
For reference, my code to create the user is as follows;
In my developer version, it all works fine!?Code:Dim profileProps(2) As Checkbox.SimpleNameValueOfObjectObject profileProps(0) = New Checkbox.SimpleNameValueOfObjectObject profileProps(0).Name = "ContactID" profileProps(0).Value = registration.ContactID profileProps(1) = New Checkbox.SimpleNameValueOfObjectObject profileProps(1).Name = "EducationNumber" profileProps(1).Value = registration.EducationNumber profileProps(2) = New Checkbox.SimpleNameValueOfObjectObject profileProps(2).Name = "Email" profileProps(2).Value = registration.EmailAddress Dim addedToCheckBox As Boolean = False Try Dim checkboxResult As String = checkBoxWS.CreateUser(authToken.Value, registration.UserName, registration.Password, profileProps, True) addedToCheckBox = True Catch ex As Exception addedToCheckBox = False End Try
I'd appreciate any help I can get please.
-
02-29-2008 01:39 PM #2
Administrator
- Join Date
- Mar 2007
- Location
- Prezza Technologies
- Posts
- 227
I'm looking at the source for the edit user page right now. There is only one place where a value is cast to a string, though I can't see how the profile property value would have anything other than a string value, especially since the values are stored as nvarchar in the database.
Just out of curiosity, if you reset IIS then access the user manager, does the problem still exist for the users?
Thank you.
-
03-03-2008 03:55 AM #3richardt Guest
Hi,
I've just tested - and yes, if I restart the IIS service it fixes the problem. This obviously isn't a practical solution for me - the webserver runs many other web sites as well.
It's almost definately application caching or something - if I leave it a while (and the application stops/starts due to the .NET lifecycle) it starts to work.
Incidently - shouldn't it always be possible to cast an integer to a string (unless its null)?
Cheers
Richard
-
03-04-2008 01:05 PM #4
Administrator
- Join Date
- Mar 2007
- Location
- Prezza Technologies
- Posts
- 227
One workaround for the IIS reset is to put Checkbox in it's own application pool and recycle that. That's obviously not a long term solution, but may work in the interim until we are able to address the issue.


LinkBack URL
About LinkBacks
Reply With Quote
