且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在文字中添加图像按钮

更新时间:2023-09-21 23:14:28

它不能在文字中完成.文字源自

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


推荐文章