如何在ImageButton白色Context.Response.BinaryWrite()中放置图像? [英] how place image in the ImageButton white Context.Response.BinaryWrite()?
问题描述
我以编程方式创建了按钮图像,我想将图像放在该图像按钮中,来自
Context.Response.BinaryWrite()
我该怎么做?
ImageButton img = new ImageButton()
{
ID = Convert.ToString (i),
高度= 171,
宽度= 150,
BorderColor = System.Drawing.Color.Gray,
};
//我想将图像放在ImageButton中
Context.Response.ContentType =image / jpg;
Context.Response.BinaryWrite(Prod [i] .img);
i created button image programmatically and i want to place image in that image button from the
Context.Response.BinaryWrite()
how can i do that?
ImageButton img = new ImageButton()
{
ID=Convert.ToString(i),
Height = 171,
Width=150,
BorderColor = System.Drawing.Color.Gray,
};
// i want to place that image in the ImageButton
Context.Response.ContentType = "image/jpg";
Context.Response.BinaryWrite(Prod[i].img);
推荐答案
http://msdn.microsoft.com/en-us/library /system.web.ui.webcontrols.image.imageurl(v=vs.110).aspx [ ^ ]
< asp :ImageButton ID =ImageButton1runat =serverImageUrl =〜/ Scripts / 1st_Wish.jpg/>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Scripts/1st_Wish.jpg"/>
这篇关于如何在ImageButton白色Context.Response.BinaryWrite()中放置图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!