views:

20

answers:

1

working in .net mvc I have a jQuery plugin consuming a List column for column where the controller outputs:

            usersData.Add(new List<object>
            {
                user.ID,
                user.FullName,
                user.Email,
                user.Company.Name,
                user.DateCreated.ToString(),
                string.Empty
            });

I want to combine objects with string literal so that jQuery gets objects like:

user.FullName + '
' + user.Company.Name

Normally, this would be easy to do in the view but the nature of the 'column-to-column' mapping on the part of the plug-in means that the concatenation has to take place in the controller.

thx

A: 

Have you tried this?

usersData.Add(new List<object>
{
    user.ID,
    user.FullName + " " + user.Company.Name,
    user.Email,
    user.DateCreated.ToString(),
    string.Empty
});
jrummell
arrgg...i've been working in tsql too much lately...i'd tried user.FullName + ' ' + user.Company.Name, .thx
justSteve
I know the feeling. I tend to type "or" in C# and "||" in sql quite often.
jrummell