I have created a user control to select a list of projects available from a bug tracking database and the project ID is assigned to a user. However, when I come to save the user, the property is not being saved. There are 2 issues to this:
1. The selected value of the dropdown is not being retained and
2. Even when manually updating the property in the immediate window, this value is not being saved in the database.
I can see the property type in the database and it all ties up across the various tables for properties etc. My code behind is:;
I tried the autopostback with no real success. However, I now appear to have another error in that it is not even registering the fact the member exists from the Member.getCurrentMember call, so it would appear to be getting worse!
Has anyone done an extension to members with usercontrols that they have got to work?
This is really frustrating as usercontrols for pages are so easy to create and implement, and unless I'm missing something here, I would have thought the membership page would work in exactly the same way.
For some reason that I can't quite figure out, the dropdowns and textboxes weren't populated by the Page_Load event so the property was always a blank or unselected value. Basically worked my way through the page lifecycyle and eventually found the controls were populated by the OnPreRender event, so I have put the save/update procedures in there and it appears to be working.
It's a bit of a cludge, and not really the correct way to do it, but it does appear to be working okay for now though.
Could this be a bug in the page lifecycle of Umbraco's membership page when using your own usercontrols?
Extending Membership/User properties
I have created a user control to select a list of projects available from a bug tracking database and the project ID is assigned to a user. However, when I come to save the user, the property is not being saved. There are 2 issues to this:
1. The selected value of the dropdown is not being retained and
2. Even when manually updating the property in the immediate window, this value is not being saved in the database.
I can see the property type in the database and it all ties up across the various tables for properties etc. My code behind is:;
Anyone got any bright ideas?
Regards
Iain
For #1 - Make sure the AutoPostBack property is set to true for the Dropdownlistbox
I tried the autopostback with no real success. However, I now appear to have another error in that it is not even registering the fact the member exists from the Member.getCurrentMember call, so it would appear to be getting worse!
Has anyone done an extension to members with usercontrols that they have got to work?
This is really frustrating as usercontrols for pages are so easy to create and implement, and unless I'm missing something here, I would have thought the membership page would work in exactly the same way.
Hi Iain,
Your code should work, that's really all you need to do.
What version are you using? There were some issues with GetCurrentMember recently that are fixed in 4.7.1.
-Tom
Finally got this to work,
For some reason that I can't quite figure out, the dropdowns and textboxes weren't populated by the Page_Load event so the property was always a blank or unselected value. Basically worked my way through the page lifecycyle and eventually found the controls were populated by the OnPreRender event, so I have put the save/update procedures in there and it appears to be working.
It's a bit of a cludge, and not really the correct way to do it, but it does appear to be working okay for now though.
Could this be a bug in the page lifecycle of Umbraco's membership page when using your own usercontrols?
Regards
Iain
is working on a reply...