CODE CS: CODE: Select All 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 btncong_Click(object sender, EventArgs e) { int soThuNhat = Convert.ToInt32(txtso1.Text); int soThuHai = Convert.ToInt32(txtso2.Text); int Kq = soThuNhat + soThuHai; txtkq.Text = Kq.ToString(); } protected void btntru_Click(object sender, EventArgs e) { int soThuNhat = Convert.ToInt32(txtso1.Text); int soThuHai = Convert.ToInt32(txtso2.Text); int Kq = soThuNhat - soThuHai; txtkq.Text = Kq.ToString(); } protected void btnnhan_Click(object sender, EventArgs e) { int soThuNhat = Convert.ToInt32(txtso1.Text); int soThuHai = Convert.ToInt32(txtso2.Text); int Kq = soThuNhat * soThuHai; txtkq.Text = Kq.ToString(); } protected void btnchia_Click(object sender, EventArgs e) { float soThuNhat = float.Parse(txtso1.Text); float soThuHai = float.Parse(txtso2.Text); if (soThuHai == 0) { } else { float chia = soThuNhat / soThuHai; txtkq.Text = chia.ToString(); } }} CODE TRANG DEFAULT CODE: Select All <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <style type="text/css"> .style1 { width: 50%; text-align center; } .style3 { width: 173px; } .style4 { width: 133px; } .style5 { width: 119px; } .style6 { width: 100%; } .style7 { width: 100%; height: 42px; text-align: center; } .style8 { color: #33CC33; } </style></head><body><form id="form1" runat="server"> <div> <table class="style1" style="border: thin solid #008000" width="50%" align="center"> <tr> <td colspan="4"> <table align="center" class="style6"> <tr> <td class="style7"> <strong><span class="style8">Tính Cộng Trừ Nhân Chia 2 Số</span><br /> </strong> </td> </tr> </table> <br /> Số 1: <asp:TextBox ID="txtso1" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="loi1" runat="server" ControlToValidate="txtso1" ErrorMessage="* Bạn phải nhập vào giá trị"></asp:RequiredFieldValidator> </td> </tr> <tr> <td colspan="4"> Số 2: <asp:TextBox ID="txtso2" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="loi2" runat="server" ControlToValidate="txtso2" ErrorMessage="* Bạn phải nhập vào giá trị"></asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style3"> <asp:Button ID="btncong" runat="server" onclick="btncong_Click" style="margin-left: 80px" Text="Cộng" /> </td> <td class="style5"> <asp:Button ID="btntru" runat="server" onclick="btntru_Click" style="margin-left: 10px" Text="Trừ" /> </td> <td class="style4"> <asp:Button ID="btnnhan" runat="server" onclick="btnnhan_Click" style="margin-left: 0px" Text="Nhân" /> </td> <td> <asp:Button ID="btnchia" runat="server" onclick="btnchia_Click" Text="Chia" /> </td> </tr> <tr> <td colspan="4"> <br /> Kết quả: <asp:TextBox ID="txtkq" runat="server"></asp:TextBox> </td> </tr> </table> </div> </form></body></html>