備忘錄_20160105(定位) 修改 回首頁

程式 2017-08-04 17:22:06 1501838526 100
asp.net 程式碼參考

asp.net 程式碼參考

Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication_20170804._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">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
  </head>
  <body>
    <form id="form1" runat="server">
    <div>
      <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
      <br />
      <br />
      這是一種測試!看看有沒有效?
    </div>
    <% Label2.Text = "中文載入~123"; %>
    <% /* TextBox1.Text = "中文載入~456"; */ %>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Label ID="Label2" runat="server"></asp:Label>
    <asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged"></asp:Calendar>
    </form>
    <script runat="server">
      
      protected void Page_Load(object sender, EventArgs e)
      {
      }
      
      protected void Button1_Click(object sender, EventArgs e)
      {
        TextBox1.Text = "Great!!";
        TextBox1.Text = "Great!!";
        TextBox1.Text = TextBox1.Text;
      }
      
      protected void Calendar1_SelectionChanged(object sender, EventArgs e)
      {
        Response.Write(Calendar1.SelectedDate.ToShortDateString());
      }
      
    </script>
  </body>
</html>


Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication_20170804
{
    public partial class _Default : System.Web.UI.Page
    {


    }
}