user1173169
user1173169

Reputation:

How to know what a function returns in C# without visual studio

I'm currently working on a C# project and i can't run it on VS since a particular CMS (Tridion) is used. nevertheless, I try to find out how i can debug some functions.

For instance a function returns a list of strings:

public List<string> FilesWithCompt () 
{
List<string> files = new List<string>();    

// instructions
return files;

}

In my view i try to display what my list contains :

<div class="definitions">

<%= FilesWithCompt () %>
</div>

What is displayed on my page:

System.Collections.Generic.List`1[System.String]

Thanks in advance for your help

Upvotes: 0

Views: 71

Answers (1)

Sergey Litvinov
Sergey Litvinov

Reputation: 7458

It displays type information. Basically it just calls files.ToString() and it returns list type.

You need to use such code:

<% foreach(string item in FilesWithCompt()){%>
      <%= item %>
<%} %>

Upvotes: 3

Related Questions