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

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -