如何在文字中添加图像按钮 [英] how can i add image button in literal
本文介绍了如何在文字中添加图像按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
如何在文字中添加imagebutton
我尝试过这样,但是我无法得到..
Hi
how can i add imagebutton in literal
i tried like this but i could''nt get..
ltrlDataString.Text += "Then" + "\t" + Action + "\t" + "<font color="#0000FF">" + CName + "<font color="Black">" + "<asp:ImageButton ImageUrl=''~/images/edit.jpg'' ID=editRule" + i + " runat=''server'' />" + "" + "";
</font></font>
如何解决..它不显示图像按钮..但我想在此文字中显示图像按钮
how to solve..it does not show image button..but i want to show image button in this literal
推荐答案
它不能在文字中完成.文字源自
it cannot be done in a literal. Literal is derived from
public class Literal : Control, ITextControl
因此只能输入文字
so text only
感谢您的提问,
您可以像下面这样跟随:
Thanks for your question,
You can follow like bellow:
this.Controls.Add(new LiteralControl("<h3>Value: "));
ImageButton imgBtn= new ImageButton ();
imgBtn.Id="editRule";
imgBtn.ImageUrl = "~/images/edit.jpg";
this.Controls.Add(imgBtn);
this.Controls.Add(new LiteralControl("</h3>"));
谢谢,
马蒙
Thanks,
Mamun
这篇关于如何在文字中添加图像按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文