ASP.NET中如何使用ImageButton圖片按鈕控件,相信很多沒(méi)有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問(wèn)題出現(xiàn)的原因和解決方法,通過(guò)這篇文章希望你能解決這個(gè)問(wèn)題。

一、常見(jiàn) ImageButton 屬性
| 屬性 | 描述 |
|---|---|
| ImageUrl | 在 ImageButton 控件中顯示的圖像的路徑。 |
| ToolTip | 提示的文本。 |
| AlternateText | 圖像無(wú)法顯示時(shí)顯示的文本。 |
二、ImageButton實(shí)例演示
前臺(tái)代碼 ImageButton.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ImageButton.aspx.cs" Inherits="WebControls_ImageButton" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/tupian/20230522/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:ImageButton ID="ibtn" runat="server" Height="20px" ImageUrl="/tupian/20230522/o_sanyecao.jpg" ToolTip="前臺(tái)指向" Width="118px" /> <br /> <br /> <asp:ImageButton ID="ibtn2" runat="server" Height="20px" ImageUrl="/tupian/20230522/o_sanyecao.jpg" ToolTip="后臺(tái)指向" Width="118px" onclick="ibtn2_Click" /> </div> </form> </body> </html>
后臺(tái)代碼 ImageButton.aspx.cs
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class WebControls_ImageButton : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ibtn2_Click(object sender, ImageClickEventArgs e)
{
//方法內(nèi)可以做很多操作
//注冊(cè),注冊(cè)成功,跳轉(zhuǎn)到主頁(yè)
Response.Redirect("~/DemoHTML.aspx");
}
}看完上述內(nèi)容,你們掌握ASP.NET中如何使用ImageButton圖片按鈕控件的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!
網(wǎng)站名稱:ASP.NET中如何使用ImageButton圖片按鈕控件-創(chuàng)新互聯(lián)
瀏覽地址:http://chinadenli.net/article20/cojsco.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開(kāi)發(fā)、Google、網(wǎng)站設(shè)計(jì)公司、微信公眾號(hào)、網(wǎng)站收錄、動(dòng)態(tài)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容