c# - How can i use foreach in Container.DataItem? -



c# - How can i use foreach in Container.DataItem? -

how can utilize in repeater itemtemplate ?

foreach(string tag in eval("etiketler")) { response.write("<a href='#'>"+tag+"</a"); }

there no way in format. should send dataitem static method , should homecoming string contains markup..

public static string getmarkup(object dataitem) { var tags = databinder.eval(dataitem, "etiketler"); // depend on etiketler type stringbuilder sb = new stringbuilder(); foreach(string tag in tags) { sb.append("<a href='#'>"+tag+"</a"); } homecoming sb.tostring(); }

use method this:

<%# getmarkup(container.dataitem) %>

c# asp.net

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -