-2
我試圖改變ImageUrl onclick我的中繼器上存在的圖像按鈕。我必須從不使用jquery或js的代碼(cs文件)後面進行更改。在此先感謝改變ImageUrl onclick ImageButton編程C#
<asp:ImageButton ID="imgLike" ImageUrl="Content/images/thumbsup.png" onclick="imgLike_Click" runat="server" style="width:25px;height:25px" />
這裏是代碼
protected void imgLike_Click(object sender, ImageClickEventArgs e)
{
ImageButton imgLike = (ImageButton)rptinserting.FindControl("imgLike");
imgLike.ImageUrl = "Content/images/thumbsup1.png";
}
這不是一個working.facing誤差..無效回發或回調參數.. – Bilal
裹的Repeater在數據綁定一個的IsPostBack'如果(!Page.IsPostBack){//綁定數據}' – VDWWD