日期:2014-05-18 浏览次数:20460 次
IList<LabelInfo> list = new Gethome.BLL.User.Label().GetListLable(UserID); StringBuilder sb = new StringBuilder(); for (int i = 1; i <= list.Count; i++) { LabelInfo la = list[i - 1]; if (i % 6 != 0) { sb.Append("<a href=\"#\" class=\"assssl\" id=\"la" + la.ID + "\">" + la.TagName + "</a>\t"); } else { sb.Append("<a href=\"#\" class=\"assssl\" id=\"la" + la.ID + "\">" + la.TagName + "</a><br/>"); } } Response.Write(sb.ToString()); Response.End();
标签:<div id="EventLable"> </div>
$.ajax({ url: 'Ajxa/LableList.aspx', type: 'get', data: "", success: function(msg) { if (msg != null) { $("#EventLable").html(msg); } else { alert(msg); } } });
$("a.assssl").click(function() { alert("asdasda"); });
<div id="EventLable"> <a id="la1" class="assssl" href="#">出来</a> <a id="la2" class="assssl" href="#">哈哈</a> <a id="la3" class="assssl" href="#">辅导费</a> <a id="la5" class="assssl" href="#">出生</a> <a id="la6" class="assssl" href="#">婚嫁</a> <a id="la8" class="assssl" href="#">生活</a> <br> <a id="la9" class="assssl" href="#">车辆</a> <a id="la10" class="assssl" href="#">房产</a> <a id="la11" class="assssl" href="#">消费</a> <a id="la12" class="assssl" href="#">学习</a> <a id="la13" class="assssl" href="#">工作</a> <a id="la14" class="assssl" href="#">理财</a> <br> <a id="la15" class="assssl" href="#">人际</a> <a id="la16" class="assssl" href="#">娱乐</a> <a id="la17" class="assssl" href="#">创业</a> </div>
$(".assssl").live("click",function(){ alert("asdasda"); });
------解决方案--------------------