• 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. MVC输出缓存(OutputCache参数详解)

    版权声明:本文为博主原创文章,未经博主允许转载随意. https://blog.csdn.net/kebi007/article/details/59199115 1.学习之前你应该知道这些 几乎每个 ...

  2. Python爬虫(二)——对开封市58同城出租房数据进行分析

    出租房面积(area) 出租房价格(price) 对比信息 代码 import matplotlib as mpl import matplotlib.pyplot as plt import pan ...

  3. iOS开发 -------- storyBoard实现控制器添加childViewController

    1 拖进去scrollView 添加约束(0,0,0,0);     2 更新scrollView约束,然后在scrollView上面加个view,设置其约束为(0,0,0,0) 和 水平滑动约束; ...

  4. Learning-MySQL【5】:数据的操作管理

    一.插入数据 1.为表的所有字段插入数据 通常情况下,插入的新纪录要包含表的所有字段 INSERT 语句有两种方式可以同时为表的所有字段插入数据,第一种方式是不指定具体的字段名,第二种方式是列出表的所 ...

  5. vs2015调试iisexpress无法启动的问题解决方案整理

    我上传的项目代码被同事下载之后使用iisexpress调试一直报错,iisexpress无法启动只能用自己本地的iis,我本地的代码却没问题,试了两种解决办法,问题解决了,在此记录一下也总结一下 方法 ...

  6. selenium+java 模糊搜索列表

    判断搜索结果是否正确 例子: 显示列表 相关HTML 获取职位名称元素 List<WebElement> elements = driver.findElements(By.cssSele ...

  7. 微信小程序,加载更多

    html <!-- 头部 --> <view class='tab'> <view class="tab-new {{selected_new?'active' ...

  8. redhat7.2安全基线BI

    (一)   Redhat linux7.2安全基线基本型(BI) 1.   密码复杂度策略 /etc/pam.d/system-auth文件中,增加内容 password requisite pam_ ...

  9. fcn+caffe+voc2012实验记录

    参考博客: http://blog.csdn.net/haoji007/article/details/77148374 http://blog.csdn.net/jacke121/article/d ...

  10. JWT ajax java spingmvc 简洁教程

    1.添加依赖 <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt</ ...