Posted on 30/08/2018 17:53:33
Hi Hans,
Based on the error you shared with us, I would say the error is in a different place. I don;t see any mention of SkipCopy in your code.
This type of error usually means that you are trying to use a variable (or object) that is not defined.
This usually is either a wrong suntax or a typo. Can also be a situation where your code block is closed improperly.
For example, here:
myndir = ItemList.GetItemListById(FleiriMyndir);
FleiriMyndir should be an Integer and I don't see it defined anywhere
And I would also avoid this approach:
<a href="?id=@i.GetString("PageId")"
Maybe you can define a variable and use it instead of combining the code in the html tag
Another possible failure can be here:
tempItem["Bruk_i_bokum"].ToString() == "Skipalistin"
If tempItem["Bruk_i_bokum"] is null, you will get an error when trying to convert null to string.
I would check the code step by step in order to find the point of failure. Check if you get the right ItemList, then if the item list has nodes, then if the parameters are not empty.
I don;t see much use of the i variable that you have declared on the QueryResultItem Loop. If your list is not dependant on the loop, you can take it outside of the loop.
Of course these are just first glance suggestions. They might not solve your problem completely. But maybe they can guide you in the right direction.
Adrian