ASP.NET Style attribute

คำนำออกและการใช้งาน

Style attribute ใช้เพื่อตั้งหรือกลับสไตล์ CSS inline ให้กับควบคุม

วลี

<asp:webcontrol id="id" Style="style" runat="server" />
ค่า รายละเอียด
style ข้อความ ค่านี้เป็น CSS สไตล์ที่กำหนดไว้ใน inline style sheet

ตัวอย่าง

ตัวอย่างนี้กำหนดสไตล์ CSS ของปุ่ม Control:

<form runat="server">
<asp:Button id="Button" Text="Submit" runat="server"
Style="font: 12pt Verdana;font-weight:700;color:orange;" />
</form>

ตัวอย่าง

เพิ่มสไตล์ที่ติดตั้งไว้ใน button Control ด้วย style attribute