添加鏈接按鈕我有它顯示了一個選項卡的列表項的鏈接按鈕:從innerHTML的
<li runat="server" id="liActivityInvoices"><a href="#tabActivityInvoices">Invoices</a><asp:LinkButton runat="server" ID="btnLoadInvoice" OnClick="btnInvoiceActivity_Click" CssClass="btnListSmall" Width="90px"></asp:LinkButton></li>
在後面的代碼它搜索發票和獲得的總收入。這則更新列表項,顯示貨幣和財政收入在標籤:
liActivityInvoices.InnerHtml = "<a href=\"#tabActivityInvoices\">Invoices (" + Company.Current.DefaultCurrency + ": " + Convert.ToDecimal(ds.Tables[1].Rows[0]["TotalRev"]) + ")</a> <asp:LinkButton runat=\"server\" ID=\"btnLoadInvoice\" OnClick=\"btnInvoiceActivity_Click\" CssClass=\"btnListSmall\" Width=\"90px\"></asp:LinkButton>";
的a href
部分顯示,但鏈接按鈕消失。如何使用InnerHtml顯示鏈接按鈕?
這一個是重複的可能https://stackoverflow.com/questions/20053217/adding -a-asp-control-to-page-from-code-behind-within-innerhtml –