• ASP.NET has its own named controls(tags) corresponding to that in an HTML document, such as <asp:Label></asp:Label> corresponds to <label>. Currently, I have found the differences and some similarities: (taking label as an example): inside a tag, when setting its properties, id for <label> is equavalent with ID for <asp:Label>, and its ok for document.getElementById() to get both kinds of elements; however document.getElementByTagName() does not apply to <asp:Label> tags.
  • Javascripts is used to manipulate any element and css property in an HTML document. It offers three ways to find an element: by ID, by TagName, by Class.
  • There are three ways to show popup windows in javascripts: window.alert(); confirm(); prompt();
  • Three are many popular js frameworks like: jQuery.js, Angular.js, Bootstrap.js, vue.js, react.js,... so forth and so on, I know just very little parts of them, not to mention mastering them.
  • Asked questions on the internet are re-viewed by me. Like how to transfer variants from front part to end part in ASP.NET developing, and the answers are found: use <%=variantName%>; or use Request.Form[variantName]; or use Post way;
  • About calling javascript functions in front .aspx page from end part in .cs page, I have experienced a lot of searching( instead of researching):
    • Use Response.Write("<script>alert('Clicked')</script>"), to transfer few data to front; thus could only use some simple inline written functions.
    • Use ClientScript.RegisterStartUpScripts()/SciptsBlock(), which did not seem to work for me.
    • Use ScriptManager ONLY when you have a UpdatePanel tag in the front part. (as far as I know)
    • Use btn(the control from front).Attribute.Add("onclick","yourFunction();"), which is only allowed to written in Page_Load() method, meanwhile, it works like this: in any case executes javascript function in .aspx first, and then the event in .cs, which means it could be called twice in maximum.
  • About page self-refreshing problem when clicking an asp:Button run on server, the classical and still popular way is; AJAX; which is useful in asp.net. Another way is to set AutoPostBack attribute to false.

Day 1: ASP.NET and JavaScript Jan.16th Trying的更多相关文章

  1. ASP.Net:Javascript 通过PageMethods 调用后端WebMethod方法 + 多线程数据处理 示例

    ASP.Net:Javascript 通过PageMethods 调用后端WebMethod方法 + 多线程数据处理 示例 2012年04月27日 16:59:16 奋斗的小壁虎 阅读数:4500   ...

  2. asp.net中javascript与后台c#交互

    asp.net中javascript与后台c#交互 作者:熊猫大叔 字体:[增加 减小] 类型:转载 时间:2015-10-23我要评论,出处:http://www.jb51.net/article/ ...

  3. ASP.NET 前台Javascript调用后台代码 / 后台调用前台Javascript

    1:ASP.NET 前台Javascript调用后台代码 1.1:前台Javascript <script> function CallCs() { var str = "< ...

  4. (二)ASP.NET中JavaScript的中英文(多语言)实现方案(二)

    在ASP.NET中JavaScript的中英文(多语言)实现方案中简单的介绍了js实现多语言的一种方案.下面将要讲述另外一种方法,尽管很相似,但是有些地方也是需要细细琢磨的,不说了,先看看. 在Lan ...

  5. ASP.NET通过JavaScript实现Button 的Enabled=false

    正常代码控制无法满足需求,所以记录一下方法: <input id="Button5" onclick=" CX()" type="button& ...

  6. (一)ASP.NET中JavaScript的中英文(多语言)实现方案

    PS: https://github.com/hzlzh/Front-End-Standards/wiki/HTML-CSS-JS-i18n 本文原始思路起源于此网址,请自行查看. 本文只是简单的一个 ...

  7. asp.net mvc + javascript导入文件内容

    .近期做的是对现有项目进行重构.WEB FROM改成MVC,其实也算是推倒重来了. 里面有一个导入功能,将文件上传.原先的做法是有一个隐藏的iframe,在这个iframe的页面中设置一个表单form ...

  8. asp.net mvc + javascript生成下载文件

    近期做的是对现有项目进行重构.WEB FROM改成MVC,其实也算是推倒重来了. 里面有一个导出功能,将数据输出成txt文件,供下载.原先的做法是有一个隐藏的iframe,在这个iframe的页面中设 ...

  9. ASP.NET—011:JavaScript报错常见问题

    相信大家都写过JavaScript.JS由于语法以及自己须要实现的业务的原因,可能在一个页面上要写长篇大论.或者单独写js文件写了好几百K.JS不可否认给Web编程带了很多的方便. 可是假设JS发生了 ...

随机推荐

  1. kvm日常维护

    1.列出物理机器上安装的虚拟[root@localhost ~]# virsh list --all Id Name State------------------------------------ ...

  2. iOS UIAlertController在iPhone与iPad上的区别

    很简单的一段代码: // 首先声明一个UIAlertController对象 private var alertController: UIAlertController! // 初始化UIAlert ...

  3. 剑指offer(60)把二叉树打印成多行

    题目描述 从上到下按层打印二叉树,同一层结点从左至右输出.每一层输出一行. 题目分析 从上到下打印二叉树我们知道用队列可以实现,但是如果多行打印怎么做呢? 我们需要分割,在行与行之间进行分割.如何分割 ...

  4. P4248 [AHOI2013]差异

    思路 SAM 后缀自动机parent树的LCA就是两个子串的最长公共后缀 现在要求LCP 所以把字符串反转一下 然后每个点的贡献就是endpos的大小,dfs一遍求出贡献就可以了 代码 #includ ...

  5. 【C++】C++未定义行为

    未定义行为:语言标准没有规定,编译器自行决定的行为,在不同的编译器上有时会有不同的结果. 1: int i=0; i=i++; 我们知道i++会返回i之后再自增,那么程序运行完i为多少? 解释一:i= ...

  6. Learning-Python【18】:Python常用模块(1)—— time、datetime、randrom

    time 模块:与时间相关的功能的模块 在 Python 中,时间分为三种: 1.时间戳:是一个时间的表示,根据不同的语言,可以是整数或浮点数,是从1970年1月1日0时0分0秒到现在经历的秒数 2. ...

  7. C#实现基于ffmpeg加虹软的人脸识别

    关于人脸识别 目前的人脸识别已经相对成熟,有各种收费免费的商业方案和开源方案,其中OpenCV很早就支持了人脸识别,在我选择人脸 识别开发库时,也横向对比了三种库,包括在线识别的百度.开源的OpenC ...

  8. Practical Node.js (2018版) 13章, Node HTTP/2 Servers

    新增的章节. If you are not using HTTP/2, then you are losing out on big improvements. HTTP/2相比http/1有很大的区 ...

  9. 异步核心接口IAsyncResult的实现

    要实现异步编程,就需要正确的实现IAsyncResult接口.IAsyncResult共有四个属性: public interface IAsyncResult { object AsyncState ...

  10. 查看局域网指定IP的电脑名

    nbtstat -a 192.168.0.139 节点 IP 址址: [192.168.0.140] 范围 ID: [] NetBIOS 远程计算机名称表 名称 类型 状态 ------------- ...