Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 1-Aug-11 21:54pm
v2
Comments
[no name] 2-Aug-11 3:56am    
What exactly you want to achive with this??

it cannot be done in a literal. Literal is derived from

public class Literal : Control, ITextControl


so text only
 
Share this answer
 
v2
Thanks for your question,

You can follow like bellow:

C#
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
 
Share this answer
 
v2
Comments
suryaswathi 2-Aug-11 4:48am    
hi how can i add this to my literal.i want to put seperate funcyion and want to call in literal ah?or where i want to add

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900