I have a function that is supposed to return ids of selected items from a list. It returns an expected value only when one file is selected. When you select multiple or none, it returns 0. I don't mind it returning 0 when nothing is selected, but how could I make it return a string of all ids when multiple files are selected? This is the function I'm using :
private int GetListItemIDFromQueryParameter()
{
int result;
Int32.TryParse(Request.QueryString["SPListItemId"], out result);
return result;
}
If more code should be added, please let me know.
///
CommandAction="~remoteAppUrl/Pages/Default.aspx?{StandardTokens}&SPListItemId={SelectedItemId}&SPListId={SelectedListId}"
It returns a value of an item's ID if only one item is selected - if you select multiple, it returns 0, just as if you selected nothing.