zoukankan      html  css  js  c++  java
  • ASP.NET -- WebForm -- .aspx与.aspx.cs文件

    ASP.NET -- WebForm --  .aspx与.aspx.cs文件

    1. ASP.NET -- WebForm(C#)文件

    .aspx文件:是Html页面,页面的布局,样式在该文件中设计。

    .aspx.cs文件:后台代码

    .aspx.designer.cs文件:由工具自动生成的代码。

    新建一个web窗体页面,在.aspx文件顶部,有下面这样一行代码必不可少:

    2. 也可以直接在.aspx文件中直接写C#后台代码,但要写在<% %>中。

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
    
    <!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>my Test Aspx</title>
    </head>
    <body>
        <p><%Response.Write("Hello World!");%></p>
        <form id="form1" runat="server">
        <div>
            <p><%Response.Write(DateTime.Now.ToLongTimeString());%></p>
        </div>
        </form>
    </body>
    </html>

  • 相关阅读:
    strstr 的使用
    提取文本中的单词,单词简单排序
    sort 与 qsort
    AC自动机妙用
    字符串中如何提取数值
    字符串提取问题
    字符串搜索
    最短路问题
    树莓派挂载移动硬盘
    Mac 更换桌面背景崩溃(闪退)
  • 原文地址:https://www.cnblogs.com/ChengWenHao/p/AspNetPart2.html
Copyright © 2011-2022 走看看