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
Post a Comment