这是我用来在客户端显示所有标签的代码......我想将锚标签功能上的参数传递到服务器端链接按钮单击
<ul class="list_load">
<% for (int i = 0; i < dtscrippsyearcount.Rows.Count; i++)
{ %>
<li class="list_item">
<asp:LinkButton runat="server" ID="lnkdisplaytag" OnClick="lnkdisplaytag_Click"></asp:LinkButton>
<a href="#" id="<%=dtscrippsyearcount.Rows[i]["TagId"].ToString() %>" onclick="javascript:GetSelectedTag('<%=dtscrippsyearcount.Rows[i]["TagId"].ToString() %>')"><%=dtscrippsyearcount.Rows[i]["TagName"].ToString() %></a></li>
<%} %>
</ul>
function GetSelectedTag(Tagid) {
__doPostBack('lnkdisplaytag ', Tagid)
$("#lnkdisplaytag").click();
return true;
}
背后的代码
protected void lnkdisplaytag_Click(object sender, EventArgs e)
{
string parameter = Request["__EVENTARGUMENT"];////want to get tagid here
}
Smart猫小萌
相关分类