Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta charset="utf-8" /> <title></title> <style> .main { height: 128px; width: 640px; position: absolute; top: 50%; left: 50%; margin-top: -64px; margin-left: -320px; } .a { height: 128px; width: 128px; float: left; } #ImageButton1, #ImageButton2, #ImageButton3 { height: 128px; width: 128px; border-radius: 50%; } </style> </head> <body> <form id="form1" runat="server"> <div class="main"> <div class="a"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img/facebook.png" OnClick="ImageButton1_Click" /> </div> <div class="a"></div> <div class="a"> <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/img/yahoo.png" OnClick="ImageButton2_Click" /> </div> <div class="a"></div> <div class="a"> <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/img/youtube.png" OnClick="ImageButton3_Click" /> </div> </div> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta charset="utf-8" /> <title></title> <style> .main { height: 128px; width: 640px; position: absolute; top: 50%; left: 50%; margin-top: -64px; margin-left: -320px; } .a { height: 128px; width: 128px; float: left; } #ImageButton1, #ImageButton2, #ImageButton3 { height: 128px; width: 128px; border-radius: 50%; } </style> </head> <body> <form id="form1" runat="server"> <div class="main"> <div class="a"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img/facebook.png" OnClick="ImageButton1_Click" /> </div> <div class="a"></div> <div class="a"> <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/img/yahoo.png" OnClick="ImageButton2_Click" /> </div> <div class="a"></div> <div class="a"> <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/img/youtube.png" OnClick="ImageButton3_Click" /> </div> </div> </form> </body> </html>
Default.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Response.Redirect("http://facebook.com/"); } protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { Response.Redirect("http://yahoo.com/"); } protected void ImageButton3_Click(object sender, ImageClickEventArgs e) { Response.Redirect("http://youtube.com/"); } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Response.Redirect("http://facebook.com/"); } protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { Response.Redirect("http://yahoo.com/"); } protected void ImageButton3_Click(object sender, ImageClickEventArgs e) { Response.Redirect("http://youtube.com/"); } }