ASP.NET中如何使用ImageButton圖片按鈕控件,相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。
一、常見 ImageButton 屬性
屬性 | 描述 |
---|---|
ImageUrl | 在 ImageButton 控件中顯示的圖像的路徑。 |
ToolTip | 提示的文本。 |
AlternateText | 圖像無法顯示時顯示的文本。 |
二、ImageButton實例演示
前臺代碼 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="前臺指向" Width="118px" /> <br /> <br /> <asp:ImageButton ID="ibtn2" runat="server" Height="20px" ImageUrl="/tupian/20230522/o_sanyecao.jpg" ToolTip="后臺指向" Width="118px" onclick="ibtn2_Click" /> </div> </form> </body> </html>
后臺代碼 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)可以做很多操作 //注冊,注冊成功,跳轉(zhuǎn)到主頁 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://aaarwkj.com/article20/cojsco.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、Google、網(wǎng)站設(shè)計公司、微信公眾號、網(wǎng)站收錄、動態(tài)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容