Top Banner
Cac the co ban trong html: <h1> Heading Level 1</h1> …… <h6> Heading Level 6</h6> <B> </B> Bold <strong></strong> <I></I> Italic <em></em> <tt> </tt> typewriter chu thanh <U></U> Underline <BR> Xuong dong <P></P> Tao doan van ban <HR> tao duong ke ngang <Blockquote> ………..text………</Blockquote> Chuc nang chen mot khoi van ban thut <Address> Liên kết tới CSS : <link type=”text/css” rel=”stylesheet” href=”stylesheet.css”>
25

Bat dau hoc lap trinh asp

Feb 10, 2017

Download

Technology

Lam To
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Bat dau hoc lap trinh asp

Cac the co ban trong html: <h1> Heading Level 1</h1>……

<h6> Heading Level 6</h6><B> </B> Bold <strong></strong>

<I></I> Italic <em></em>

<tt> </tt> typewriter chu thanh

<U></U> Underline

<BR> Xuong dong

<P></P> Tao doan van ban

<HR> tao duong ke ngang

<Blockquote> ………..text………</Blockquote> Chuc nang chen mot khoi van ban thut

<Address> Liên kết tới CSS : <link type=”text/css” rel=”stylesheet” href=”stylesheet.css”>

Page 2: Bat dau hoc lap trinh asp

<BaseFont> Thiet lap font Style chu cho toan van ban<p style="font-size: 12px"><h2 style="color:red"><h2 style="color: green; font-size:12px"><h1 style="font-family: Arial">Title</h1><p style="background-color: red;">Hello!</p><!--This is an example of a comment!--><h1 style="text-align:center">font-weight: bold;text-transform: uppercase;text-decoration:none || underline; //link khong co gach chan o duoi

<Border> Thiet lap box cho đối tượngborder:1px dashed blue; rong 1 dang cham bi, xanhborder:1px solid black; dang duong thangborder-radius: 5px; Tao mot border hinh tu

Tập các ký hiệu đặc biệt&lt;html&gt;

http://www.degraeve.com/reference/specialcharacters.php

Vị trí các elementline-height: 50px; Line height bang height de text o giua button

margin:auto; set cho element ra giua

margin-top: /*some value*/

Page 3: Bat dau hoc lap trinh asp

margin-right: /*some value*/margin-bottom: /*some value*/margin-left: /*some-value*/

float:right;element { clear: /*right, left, or both*/}

padding:0px 30px 0px 10px;

margin: 10px 5px 5px 50px

Position:Mặc định là static và không dùng được các giá trị left right top bottom

Position: absoluted : Vị trí của nó không phụ thuộc vào cha

Position: relative: Vị trí của nó phụ thuộc vào vị trí của cha

position_Parent="relative" thi tuc la con chay theo cha cac con cua no se co thuoc tinh top left right bottom theo no

position_Child="absolute" thi tuc la no se chay theo cha no co the de len cac phan tu khac

Position:Fixed : Vị trí của nó lăn theo con lănmargin-left:auto; SET DIV CENTERmargin-right:auto; SET DIV CENTER

div {

display: inline-block;

margin-left: 5px;

height:100px;

width:100px;

border-radius:100%;

border: 2px solid black;

border-top-left-radius: 15px;

border-top-right-radius: 15px;

text-align:center;

Page 4: Bat dau hoc lap trinh asp

}

span{

display:inline-block;

margin-top:30;

text-align:center;

line-height:20px;

}

Link-Visited-Hovera:link: An unvisited link.a:visited: A visited link.a:hover: A link you're hovering your mouse over.

a:unvisited

z-indexChon conChú ý trong CSS thì các id luôn xếp sau, class xếp trước còn các selector thông thường trên cùng

div “.””#””style”

p:first-child { color: red;}p:nth-child(4){}display: inline-block;Mac dinh cac thanh phan nhu <div> <h1> <h6> la block tuc la khi xep nhieu thi chung tu xuong hang nhung neu chi muon no o vi tri cua no ta dung inlinelay con dau tien

div> p chi truc tiep den thang con

Page 5: Bat dau hoc lap trinh asp

div p tro den ca con lan chau<font size = “6” face = “ “ color = “ “>

<Pre > Hien thi dang chu danh may

<Sub> Van ban viet duoi dang Subscript. Van ban in thap hon chu thuong

<Sup> Van ban viet duoi dang Supperscript. Van ban in hoi cao hon chu thuong

<Big> va <Small> Font size chu lon hoac nho

<Marquee align = “middle-Top - Bottom” direction = “right- Left” scrolldelay = “60” Loop = “” Behavior = “scroll – slide – alternate” >

Input

Page 6: Bat dau hoc lap trinh asp

Video:

<video width="320" height="240" controls>

<source src="https://s3.amazonaws.com/codecademy-content/projects/make-a-website/lesson-1/ollie.mp4" type="video/mp4">

Page 7: Bat dau hoc lap trinh asp

Tablevalign=”center”-“button”-“top”<table>

<tr><td colspan =”2”><td>

</tr><tr>

<td rowspan =”2”><td><td></td>

</tr><tr>

<td>

<td></tr>

</table>

Frame<frameset rows = "30%, *"> chia thành 2 hàng, hàng thứ nhất chiếm 30% màn hình, còn lại là hàng thứ 2.

<frameset cols = "*, 100, *"> chia 3 cột, cột thứ 2 có độ rộng 100 điểm, các cột còn lại sẽ tự động phân chia.

<frameset rows = "30%, *" border=0 framespacing = 5 frameborder = 0>: đặt đường viền, khoảng cách, ...

<frame src="URL"

name="tên cửa sổ"

with = "N"

height = "M"

scrolling = "yes/no/auto"

frameborder = "yes/no"

framespacing = "N"

bordercolor = #xxyyzz

noresize >

Page 8: Bat dau hoc lap trinh asp
Page 9: Bat dau hoc lap trinh asp

Tạo các trang con Header.html, left.html, main.html, footer.html <frameset rows="50,*,50"> <frame src="header.html" /> <frameset cols="30%,*"> <frame src="left.html" /> <frame src="main.html" /> </frameset>

<frame src="footer.html" /> <noframes> Trình duyệt không hỗ trợ Frame </noframes> </frameset>

Chapter Summary Use the style attribute for styling HTML elements Use background-color for background color Use color for text colors Use font-family for text fonts Use font-size for text sizes Use text-align for text alignment Span dùng để nhóm một khối phần tử trong khi Div nhóm nhiều phần tử

Page 10: Bat dau hoc lap trinh asp

Cac cau truc dieu khien trong java scrip<SCRIPT language = “JavaScript”>while(bt_dk){}for(…)if(){} else{}alert(“ ” + …);function ten_ham(thamso_1, thamso_2, …..){code}khai bao bien dung var x = “”;onChange Người sử dụng đổi giá trị trong đối tượng (textbox, checkbox, select..)

onClick Người sử dụng nhấn nút chuột lên đối tượng

onMouseOver Người sử dụng đưa con trỏ lướt ngang qua đối tượng

onMouseOut Người sử dụng đưa con trỏ ra khỏi đối tượng

onSubmit Kích hoạt biểu mẫu gửi đi

onBlur Di chuyển con trỏ ra khỏi đối tượng

onFocus Đối tượng nhận con trỏ

onLoad Một trang đã tải xuống hoàn chỉnh

onUnload Người sử dụng rời khỏi trang hoặc tải lại trang

Event/ Html Element

Blur Click Change Focus Load MouseOver MouseOut Submit Unload

Text x x x x x xListbox x x x x x xButton x x x x xCheckbox

x x x x x x

Form xLink x x xRadio xReset xSubmitTextarea x x xbody x x

Page 11: Bat dau hoc lap trinh asp

VIDU<title></title><SCRIPT LANGUAGE = “JavaScript”>

<!—hide form other browsers

function welcome() {}

// stop hiding from other browsers

</SCRIPT>

</head>

<body onLoad = “welcome();” onUnload = “welcome();”>

</body>

<style>#header {    background-color:black;    color:white;    text-align:center;    padding:5px;}#nav {    line-height:30px;    background-color:#eeeeee;    height:300px;    width:100px;    float:left;    padding:5px; }#section {    width:350px;    float:left;    padding:10px; }#footer {    background-color:black;    color:white;    clear:both;    text-align:center;    padding:5px; }< /style>

Page 12: Bat dau hoc lap trinh asp

Website Layout Using HTML5HTML5 offers new semantic elements that define different parts of a web page:

<header> - Defines a header for a document or a section

<nav> - Defines a container for navigation links

<section> - Defines a section in a document <article> - Defines an independent self-

contained article <aside> - Defines content aside from the

content (like a sidebar) <footer> - Defines a footer for a document

or a section <details> - Defines additional details <summary> - Defines a heading for the

<details> element

This example uses <header>, <nav>, <section>, and <footer> to create a multiple column layout:

JavaScipt – CodeLệnh hiển thị ra màn hình

- document.write(String)- document.writeln(String)- alert(String)- var name = window.prompt(String ….)

Lệnh với function()- new - with(object){}- eval(String)- parseInt(string,10-2-16)

Page 13: Bat dau hoc lap trinh asp

- parseFloat(string)

Mảngfunction InitArray(numElements) { this.length = numElements; for (var x=1; x<=numElements; x++){ this[x]=0 } return this; } myArray = new InitArray(10); myArray[1] = "Nghệ An"; myArray[2] = "Hà Nội"; document.write(myArray[1] + "<BR>");

Page 14: Bat dau hoc lap trinh asp

JavaScript- Object

Page 15: Bat dau hoc lap trinh asp

Bảng quy tắc Regular ExpressionBài viết được đăng tại freetuts.net - [email protected]

Chúng ta sẽ chia thành từng nhóm để sau này dễ tìm kiếm.

Modifiers

Modifier Description

i So sánh không phân biệt chữ hoa chữ thường (case-insensitive)

g So sánh toàn bộ chuỗi dù trong chuỗi có xuống hàng (global)

m So sánh nhiều dòng (multiline)

Brackets

Expression Description

[abc] Tìm các ký tự a, b hoặc c

[^abc] Tìm các ký tự không phải a, b và c

[0-9] Tìm các ký tự là chữ số từ 0-9

[^0-9] Tìm các ký tự không phải chữ số từ 0-9

(x|y) Tìm ký tự x hoặc y

Page 16: Bat dau hoc lap trinh asp

\b[\D\d._%+-]+@[\D\d.-]+\.[\D]{2,6}\b t44fff @gmail .com

Metacharacters

Expression Description

. Tìm ký tự bất kì

\w Tìm ký tự chữ cái

\W Tìm các ký tự không phải là chữ cái

\d Tìm ký tự là chữ số

\D Tìm ký tự không phải là chữ số

\s Tìm ký tự là khoảng trắng

\S Tìm ký tự không phải khoảng trắng

\b Tìm so khớp bắt đầu hoặc kết thúc chuỗi

\B Tìm so khớp không phải bắt đầu hoặc kết thúc chuỗi

\0 Tìm ký tự NULL

\n Tìm ký tự xuống hàng

\t Tìm ký tự tab

Quantifiers

Expression Description

+ Kiểm tra ký tự xuất hiện một hoặc nhiều lần

* Kiểm tra ký tự xuất hiện không hoặc nhiều lần

Page 17: Bat dau hoc lap trinh asp

Expression Description

? Kiểm tra ký tự xuất hiện không hoặc một lần

{X} Kiểm tra ký tự xuất hiện đúng X lần

{X,Y} Kiểm tra ký tự xuất hiện tối thiểu X lần và tối đa Y lần

{X,} Kiểm tra ký tự xuất hiện ít nhất X lần

^ Kiểm tra ký tự bắt đầu chuỗi

$ Kiểm tra ký tự kết thúc chuỗi

Window

Thuộc tính Ý nghĩa Phương thức Ý nghĩadefaultStatus Thông báo ngầm

định hiển thị lên trên thanh trạng thái của cửa sổ

alert(“message”) Hiển thị hộp thoại với chuỗi message và ok

Frames Mảng xác định các frame trong cửa sổ

clearTimeout(timeoutID) Xóa timeout

Length Số lượng các frame trong cửa sổ cha mẹ

windowReference.close Đóng cửa sổ windowReference

Name tên cửa sổ hiện thời

confim(“message”) Hiển thị hộp thoại với chuỗi message. OK và cancle

Parent Đối tượng cửa sổ cha mẹ

prompt(“message”, input) nhập

Self Cửa sổ hiện thời TimeoutID=setTimeout(experession, msec)

Đánh giá biểu thức expression

Status Ghi đè lên defaultStatus

Top Cửa sổ trên cùngWindow Cửa sổ hiện thời

Page 18: Bat dau hoc lap trinh asp

ADO.Net

Kết nối cơ sở dữ liệuusing System;using System.Collections.Generic;using System.ComponentModel.DataAnnotations;using System.Data.Entity;using System.Linq;using System.Web;

namespace Myclasshello.Models { public class SinhVien { public int id { get; set; } [Required(ErrorMessage="Phai nhap truong nay")] [Display (Name="Họ và tên")] public string hoten { get; set; } [DisplayFormat (DataFormatString="{0:dd:mm:yyyy")] public DateTime ngaysinh { get; set; } public string diachi { get; set; }

} public class SinhVienDbContext : DbContext { public DbSet<SinhVien> SinhVien { get; set; }

Page 19: Bat dau hoc lap trinh asp

}}

Html5, Css3,JavaScript - > Jquery -> AJAX || ASP.NET -> JSON -> BootsTRap -> NoteJS -> Bat dau hoc lap trinh ASP.NET

Lập trình C#Các biến khai báo public private protected

Lệnh vào ra: i = Convert.ToInt32(Console.ReadLine());44

Console.WriteLine("1. Thuc hien phep cong");

Lớp và đối tượngCông thức để tạo một class AccessModifier class className { // thân class }

Page 20: Bat dau hoc lap trinh asp

Kế thừa

override

Override thông minh

Page 21: Bat dau hoc lap trinh asp
Page 22: Bat dau hoc lap trinh asp

Enum

IO Namespace chứa những lớp cho phép thao tác đọc và ghi dữ liệu đến những luồng dữ liệu và file. Một số lớp của System.IO được liệt kê như sau:

BinaryReader Binary Writer Stream TextReader TextWriter Directory File FileSystemInfo

Page 23: Bat dau hoc lap trinh asp