zoukankan      html  css  js  c++  java
  • VS.NET(C#-2.5)_简单例子(所有控件都转换成HTML控件)

    简单例子

    UI设计视图

       

     UI代码视图

    <% @PageLanguage="C#" AutoEventWireup="true"CodeFile="Default.asp.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>

    </head>

    <body>   

        <form id="form1" runat="server">    

        <div>         

        <h1>

                    ASP.NET Server Controls                          

              </h1>

             <h2>

                    The date and Time is

                    <%=DateTime.Now.ToString() %>

             </h2>

       <p>
                &nbsp;
             </p>

       <p>
               <asp:TextBox ID="txtBookName" runat="Server" Text="Enter a Book Name"></asp:TextBox>
                    &nbsp;
             </

             
              <p>
               < asp:Button ID="btnBookName" runat="Server" Text="Book Name"   OnClick="btnBookName_Click1"/>

          &nbsp;
            </p>
             
           <p>
               <asp:Label ID="lblBookName" runat="Server" ></asp:Label>

          &nbsp;
             </p>

            </div>    

      </form>

    </body>

    </html>

    UI服务器端代码视图

    using System;

    using System.Data;

    using System.Configuration;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Web.UI.HtmlControls;

    public partial class _Default : System.Web.UI.Page

    {    

       protected void Page_Load(object sender, EventArgs e)    

      {

         }      

      protected void btnBookName_Click1(object sender, EventArgs e)  

        {       

         lblBookName.Text = txtBookName.Text;   

        }

    }

    UI浏览器运行效果

    浏览器页面代码(HTML代码)

     注:上述所有控件都转换成HTML控件。

  • 相关阅读:
    读书笔记——吴军《态度》
    JZYZOJ1237 教授的测试 dfs
    NOI1999 JZYZOJ1289 棋盘分割 dp 方差的数学结论
    [JZYZOJ 1288][洛谷 1005] NOIP2007 矩阵取数 dp 高精度
    POJ 3904 JZYZOJ 1202 Sky Code 莫比乌斯反演 组合数
    POJ2157 Check the difficulty of problems 概率DP
    HDU3853 LOOPS 期望DP 简单
    Codeforces 148D. Bag of mice 概率dp
    POJ3071 Football 概率DP 简单
    HDU4405 Aeroplane chess 飞行棋 期望dp 简单
  • 原文地址:https://www.cnblogs.com/ximi07/p/10881828.html
Copyright © 2011-2022 走看看