2022年4月21日 星期四

[研究][ASP.NET]讓超連結或 LinkButton 看起來像是按鈕

[研究][ASP.NET]讓超連結或 LinkButton 看起來像是按鈕

2022-04-21

環境:Visual Studio 2022 + ASP.NET + WebForm + Web Application + C#


Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" 
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <input id="Button1" type="button" value="button" /><br />
        <button>按鈕</button><br />
        <asp:Button ID="Button2" runat="server" Text="Button" /><br />
        <br />
        <asp:HyperLink ID="HyperLink1" NavigateUrl="xx"
            Style="border: 1px solid #000000; background-color: #efefef; 
            padding: 5px; margin: 5px; text-decoration: none; 
            border-radius: 5px;"
            runat="server">HyperLink</asp:HyperLink><br />
        <br />
        <asp:LinkButton ID="LinkButton1"
            Style="border: 1px solid #000000; background-color: #efefef; 
            padding: 5px; margin: 5px; text-decoration: none; 
            border-radius: 5px;"
            runat="server">LinkButton</asp:LinkButton>
    </form>
</body>
</html>



(完)

相關

沒有留言:

張貼留言