Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • ds 191 posts 223 karma points
    Mar 22, 2011 @ 09:54
    ds
    0

    Populate dropdownlist and Listbox from Member Data for editing on frontend

    I created a member section where logged in members could change its profile information but I stuck at how I can retrieve back those saved values on frontend for editing.

    The code snippet below is for creating user but I do not know how to retrieved back those saved values.

                    DropDownList ddlSector = (DropDownList)CreateUserWizardStep0.FindControl("Sector");
    string lbSectorValue = "";
    foreach (ListItem item in ddlSector.Items)
    if (item.Selected) lbSectorValue += (lbSectorValue == "" ? "" : ",") + item.Value;
    mp.Sector = lbSectorValue;

    ListBox lbJobDescription = (ListBox)CreateUserWizardStep0.FindControl("JobDescription");
    string lbJobDescriptionValue = "";
    foreach (ListItem item in lbJobDescription.Items)
    if (item.Selected) lbJobDescriptionValue += (lbJobDescriptionValue == "" ? "" : ",") + item.Value;
    mp.JobDescription = lbJobDescriptionValue;

    Any help much appreciated

  • ds 191 posts 223 karma points
    Mar 24, 2011 @ 08:03
    ds
    0

    Any idea?

  • Rich Green 2246 posts 4008 karma points
    Mar 24, 2011 @ 09:35
    Rich Green
    0

    Hey ds,

    You can access the member properties using umbraco.library:GetMember()

    In xslt see here for an example

    http://our.umbraco.org/forum/developers/xslt/15177-Can't-Access-Member-Properties-(Using-452)

    Or in c# look here 

    http://our.umbraco.org/forum/developers/xslt/2644-Access-a-custom-member-property-in-XSLT

    Rich

  • ds 191 posts 223 karma points
    Mar 24, 2011 @ 10:03
    ds
    0

    Hi Rich,

    Thanks for the info you supplied. I will have a look at it. In code behind, how can I get member property data from either dropdownlist or listbox custom data type on backend and populate either dropdownlist or listbox with user selection on frontend? Thats where I stuck at actually.

  • Rich Green 2246 posts 4008 karma points
    Mar 24, 2011 @ 10:06
    Rich Green
    0

    HI Ds,

    Sorry, I'm a little confused about what you are trying to do?

    Could you please explain a little further, screenshots are often helpful too.

    Rich

  • ds 191 posts 223 karma points
    Mar 24, 2011 @ 10:26
    ds
    0

    Rich,

    Following is from backend in member section

    and that picture below is from frontend. Logged in user should see their profile information like in the above but I can get only values not user selection.

    Hope this time I have made myself clear.

  • Rich Green 2246 posts 4008 karma points
    Mar 24, 2011 @ 10:46
    Rich Green
    0

    Sorry I'm still a little confused.

    Are you saying that you want to get member data (JobDescription for example) for a member in the drop down on your front end (Ahsap Malzeme for example?)

    Rich

  • ds 191 posts 223 karma points
    Mar 24, 2011 @ 11:08
    ds
    0

    That is right, Rich.

    Like Ahsap Malzeme and Akvaryum-Hayvan Bakm ve Malzemeleri should be seen as selected on frontend as well.

  • ds 191 posts 223 karma points
    Mar 25, 2011 @ 13:29
    ds
    0

    Did you have any chance to look at my little problem, Rich?

  • ds 191 posts 223 karma points
    Mar 28, 2011 @ 13:50
    ds
    0

    Rich, Can you point me to right direction on this issue?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 28, 2011 @ 14:10
    Tom Fulton
    0

    Hi,

    I think you just need to set the Selected Value of your ListBox, right?

    ie,  lbJobDescription.SelectedValue = mp.JobDescription;

    -Tom

  • ds 191 posts 223 karma points
    Mar 29, 2011 @ 13:12
    ds
    0

    Hi Tom,

    The problem is to populate dropdown or listbox with the selected value like shown above in my previous posts

Please Sign in or register to post replies

Write your reply to:

Draft