【发布时间】:2010-09-19 00:24:33
【问题描述】:
我有三个图像按钮,它们具有默认图像 url,当用户单击任何图像按钮时,我尝试更改图像 url,当用户单击其他图像按钮时,默认检索尝试这样做,但我没有
<aspx>
<div class="hom_but_sa hom_but_saR">
<asp:ImageButton ID="BTNPromotion" ImageUrl="images/home-bu_npro.jpg"
runat="server" Width="134" Height="34" border="0"
OnClick="BTNPromotion_Click" />
</div>
<div class="hom_but_a hom_but_sbR">
<asp:ImageButton ID="BTNNewProduct" ImageUrl="images/home-bu_pro.jpg"
runat="server" Width="134" Height="34" border="0"
OnClick="BTNNewProduct_Click" />
</div>
<div class="hom_but_a">
<asp:ImageButton ID="BTNEvent" runat="server" ImageUrl="images/home-bu_news.jpg"
Width="134" Height="34" border="0" OnClick="BTNEvent_Click" />
</div>
</div>
<cs>
protected void BTNEvent_Click(object sender, ImageClickEventArgs e)
{
BTNEvent.ImageUrl = "images/home-bu_news.jpg";
}
protected void BTNNewProduct_Click(object sender, ImageClickEventArgs e)
{
BTNNewProduct.ImageUrl = "images/home-bu_pro_r.jpg";
}
protected void BTNPromotion_Click(object sender, ImageClickEventArgs e)
{
BTNPromotion.ImageUrl = "images/home-bu_npro_r.jpg";
}
【问题讨论】:
-
那么问题出在哪里?我测试了你的代码,它正在工作......有什么遗漏吗?请发布实际发生的事情以及您期望发生的事情。