Displaying repeater item values using K#

Jeff Steil asked on April 17, 2014 09:54

I am using k# to print the values of a document using the Head HTML Code web part. Everything is working fine but I also have a repeater on the page and I would like to print the value of the "Image" field for each item in the repeater using k# but I can't figure out how to do it.

The repeater has an id of "repSlideshow" and each of the items in the repeater has an "Image" field. I've tried using the foreach but am not sure how to iterate over the different items. Is this something I can do using k#? Thanks for the help.

Recent Answers

Juraj Ondrus answered on April 30, 2014 04:06


Sorry for the late reply.

The is no pre-defined macro method for this. You can either create a custom macro for this and use the API to access the controls collection, find the repeater and access its dataset to get the value you need. (custom macros).

You could use K# - but in this case the K# macro will basically be the same as the API code in a custom macro - you would use the same methods and the macro would be pretty complex and hard to read and debug in case of problems.

Best regards,
Juraj Ondrus

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.