Copied to clipboard

Flag this post as spam?

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


  • Pradeep 39 posts 158 karma points
    Jul 08, 2015 @ 15:44
    Pradeep
    0

    Can't able to get member item values

    Hello Everyone,

    I having a problem that I have a page node , where I create a multi picker for members.

    After picking the members, it is returning member ids example 2551 , 2514

    var page  = @CurrentPage.mymember;
    var my = ApplicationContext.Current.Services.MemberService.GetAllMembers(page);
    

    I also not able to convert the var page value in array via linq or int.parse

    .GetAllMembers(int[] ids);
    

    How I do that so I able pass member id one by one ... forloop also throwing error ...

    Please help me ..

    Thanks

  • Matt Barlow | jacker.io 164 posts 740 karma points c-trib
    Jul 08, 2015 @ 21:32
    Matt Barlow | jacker.io
    100

    Can do it this way:

    @{
        string mems = Model.Content.GetPropertyValue<string>("members") ?? string.Empty;
        int[] memsIDs = Array.ConvertAll(mems.Split(','), int.Parse);
        IEnumerable<IMember> members = ApplicationContext.Current.Services.MemberService.GetAllMembers(memsIDs);
    {
    @foreach(IMember member in members){
    
        @member.Name <br/>
        <br/>
        foreach(var prop in member.Properties)
        {
            @(prop.Alias + ": " + (prop.Value ?? string.Empty)) <br/>
    
        }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft