我有一个Image
控件,我在服务器端Repeater
分配,但我发现它在分配之前自动添加“UserControl/”文本很奇怪。例如:ImageUrl
ItemDataBound
ImageUrl
protected void rtTopSinger_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
Image imgSinger = (Image)e.Item.FindControl("imgSinger");
imgSinger.ImageUrl = "Admin/images/NotAvailable.jpg";
}
然后它会像这样呈现
<img id="ContentPlaceHolder1_TopSingers_rptTopSinger_imgSinger_2"
src="UserControl/Admin/images/NotAvailable.jpg"
alt="Image of the Singer diljit dosanjh">
为什么要添加它?我怎样才能避免这种情况?