• 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控件。

  • 相关阅读:
    SMTP协议原始命令码和工作原理[转]
    VC++ SMTP协议电子邮件传送剖析
    C++编译模式(转)
    IE6下select标签覆盖div的完美解决办法
    星级评论插件
    CSS Reset CSS Framework
    if判断IE浏览器的类型
    通过Prototype属性添加Array删除重复数据方法
    Javascript性能优化
    我自己的Javascript 库,封装了一些常用函数
  • 原文地址:https://www.cnblogs.com/ximi07/p/10881828.html
Copyright © 2020-2023  润新知