zoukankan      html  css  js  c++  java
  • Day 1: ASP.NET and JavaScript Jan.16th Trying

     

    • 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.
  • 相关阅读:
    python两个装饰器的运算顺序
    python中私有属性的访问
    python中的方法使用
    创业,宁愿单兵作战也不要参在拙劣的团队里继续寻觅队友
    项目经理问:为什么总是只有我在加班 – 挂包袱现象
    我该怎么安排下属的工作-项目经理如何分配任务
    项目经理自己要写代码吗?
    管理系统书籍《从程序员到项目经理》 从程序员到项目经理(一)
    宗宁:赚快钱的那些坑。。(转载)
    java 实现二分法
  • 原文地址:https://www.cnblogs.com/ericwonne1996wangqifan/p/8298340.html
Copyright © 2011-2022 走看看