ASP.Net学习笔记002--ASP.Net服务端控件做了什么2

以前写的课程都没有附上源码,很抱歉!
课程中的源码可以加qq索要:1606841559
技术交流qq1群:251572072
技术交流qq2群:170933152
也可以自己下载:
ASP.Net学习笔记002ASP.Net服务端控件做了什么2.zip
http://credream.7958.com/down_20144361.html
1.程序结构
项目中:
WebForm1.aspx下有两个文件:
WebForm1.aspx中代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    </div>
    //原来的html代码也可以和asp.net引擎中的控件写到一起
    //   <input type ="button;" name ="" />
    //1.注意这里的button;后需要加引号,否则会出现由于xml规则引起的警告
    //2.
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" οnclick="Button1_Click" Text="Button" />
    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
    </form>
</body>
</html>
------------------------------------------------------
  <input id ="abc"  type="Button" value ="tuzhu" runat="server"  />
   <!--
   1.runat="server"有这句的是服务器控件,没这句的是html控件
   -->
-------------------------------------------------------------------
WebForm1.aspx.cs用于写逻辑
WebForm1.aspx.designer.cs
-----------------------------------------------------------
上课中的例子,asp.net引擎会自动生成如下html代码:
<!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><title>
</title></head>
<body>
    <form method="post" action="WebForm1.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJODcwNjAxNTI1ZGRiIB7rVQurxN6PSjZOEyCrkP00D6r1puuxdi+HAKhLLw==" />
</div>
<div class="aspNetHidden">
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQLu3v3PDALs0bLrBgLs0fbZDAKM54rGBgLs0Yq1BZ6QsF/eCv2iwBXy0TytLvnomEZFJdI8yJ+PesYxhzgI" />
</div>
    <div>
    </div>
    <input name="TextBox1" type="text" value="2" id="TextBox1" />
    <input name="TextBox2" type="text" value="3" id="TextBox2" />
    <input type="submit" name="Button1" value="Button" id="Button1" />
    <input name="TextBox3" type="text" value="5" id="TextBox3" />
    </form>
</body>
</html>

-------------------------------------------------------------------
ASP.Net中可以写入原生态的html和JavaScript
比如:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebForm.WebForm1" %>

<!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">
    <script src ="Scripts/jquery-1.4.1.min.js" type="text/javascript" ></script>
    <script type ="text/javascript" language ="javascript" >
        $(function () {
            $("#TextBox3").mouseover(function () {
                $(this).css("color", "Red");
            });
        });

</script>
    <div>
    </div>
    <!--  <input id ="abc"  type="Button" value ="tuzhu" runat="server"  />
  1.runat="server"有这句的是服务器控件,没这句的是html控件
   服务器控件,服务器控件可以在代码中.出来
   <asp:Button ID ="MyControl" runat ="server" />  
   1.asp.net控件也可以自己写
   -->
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" οnclick="Button1_Click" Text="Button" />
    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
    </form>
</body>
</html>
------------------------------------------------------------------

ASP.Net学习笔记002--ASP.Net服务端控件做了什么2相关推荐

  1. jqueryui dialog asp.net服务端控件失效问题解决

    最近使用jQuery Dialog做添加功能,发现服务端控件全部失效. 查资料是因为Dialog层被appendto 到了 body里,不在form里. 但网上给的解决方案我都不满意,觉得jQuery ...

  2. IOS学习笔记(四)之UITextField和UITextView控件学习

    IOS学习笔记(四)之UITextField和UITextView控件学习(博客地址:http://blog.csdn.net/developer_jiangqq) Author:hmjiangqq ...

  3. LabView学习笔记(三):基本控件

    Labview学习笔记: LabView学习笔记(一):基础介绍 LabView学习笔记(二):滤波器实验 LabView学习笔记(三):基本控件 LabView学习笔记(四):动态数据类型 LabV ...

  4. 学习笔记:VB.net动态添加控件数组并传递事件

    学习笔记:VB.net动态添加控件数组并传递事件 控件数组和事件 "中间人" 动态添加控件 控件数组和事件 新建一个用户窗体,在定义控件数组时,不能用Withevnets来定义数组 ...

  5. jquery 操作服务端控件,select 控件

    <asp:DropDownList ID="ddl" runat="server"></asp:DropDownList> <se ...

  6. Asp.net中服务端控件事件是如何触发的(笔记)

    Asp.Net 中在客 户端触发服务器端事件分为两种情况: 一.   WebControls中的Button 和HtmlControls中的Type为submit的HtmlInputButton 这两 ...

  7. 用JS验证asp.net服务端控件

    可以用javascript来验证asp.net服务端的控件,不过目前只局限于验证textbox(输入框)不能为空的情况.还有一个前提条件是,提交按钮必须是html的控件,再加上一个runat=serv ...

  8. ASP.NET 2.0 中的新增服务、控件与功能概述(四)

    原文出自http://blog.sina.com.cn/s/blog_48b6cd65010004fc.html 个性化 另一个新增的服务是个性化,它提供了一种现成的解决方案,用于解决存储站点用户的个 ...

  9. Netty4 学习笔记之一:客户端与服务端通信 demo

    前言 因为以前在项目中使用过Mina框架,感受到了该框架的强大之处.于是在业余时间也学习了一下Netty.因为Netty的主要版本是Netty3和Netty4(Netty5已经被取消了),所以我就直接 ...

最新文章

  1. 【PAT乙级】1036 跟奥巴马一起编程 (15 分)
  2. SAP C4C的URL Mashup无法添加到embedded component里去
  3. 如何为SAP Cloud for Customer Lead页面配置自定义的Source字段
  4. android+联系服务器时间,android配置时间服务器+亚洲主要的授时服务器
  5. MYSQLMANAGER实例管理器总结
  6. Docker Weave 介绍 or 工作原理
  7. 线程安全之原子性Atomic(AtomicInteger|LongAdder|AtomicLong)
  8. J2EE技术-Spring轻量级框架
  9. 【原创】2021-2001中国科技统计年鉴面板数据、中国科技年鉴(830个指标,可直接用)
  10. donet学习笔记4(validate)
  11. 西工大计算机学院导师赵歆波,黎永前_西北工业大学研究生导师信息
  12. 三分钟了解区块链AR游戏Triffic2.0版本
  13. Emoji 的处理 - 使用正则表达式匹配所有 Emoji表情
  14. sau交流学习社区第三方登陆github--oauth来实现用户登录
  15. 迅雷在下载网页视频时没有自动弹出提示,怎么办?
  16. 项目开发过程中如何使用免费开发手机验证码验证功能(详细教程)
  17. 韩国两大火暴美女迪厅拼舞 精彩视频
  18. 网络数据保障ptop_pTop
  19. AI开放平台:发布车辆五项信息、投保日期在线查询api接口
  20. spd供应链是啥?为啥医用物资管理会运用?

热门文章

  1. ubuntu下卸载cuda8.0,和安装cuda9.0,cudnn7.0,tensorflow-gpu=1.8
  2. ZZ_MODIFIED_GEEBINF 不可用
  3. 自由在博客里插入广告,有钱你不赚吗???
  4. 吴恩达深度学习2.1练习_Improving Deep Neural Networks(Initialization_Regularization_Gradientchecking)
  5. 阿里云全站加速DCDN全面支持WebSocket协议
  6. Hadoop(八)Java程序访问HDFS集群中数据块与查看文件系统
  7. thinkphp3.2 cli模式的正确使用方法
  8. 手把手教你在友善之臂tiny4412上用uboot启动Linux内核
  9. css3响应式布局设计——回顾
  10. [webpack] 如何把代码内联进html中?