Thứ Hai, 17 tháng 3, 2014

Tài liệu CHƯƠNG III: HTML SERVERCONTROL VÀ WEB SERVER CONTROL docx


LINK DOWNLOAD MIỄN PHÍ TÀI LIỆU "Tài liệu CHƯƠNG III: HTML SERVERCONTROL VÀ WEB SERVER CONTROL docx": http://123doc.vn/document/1038177-tai-lieu-chuong-iii-html-servercontrol-va-web-server-control-docx.htm



Hệ thống thứ bậc của HTML Server Controls
System.Object
System.Web.UI.Control
HtmlControl
HtmlImage
HtmlInputControl
HtmlInputFile
HtmlInputHidden
HtmlInputImage
HtmlInputRadioButton
HtmlInputText
HtmlInputButton
HtmlInputCheckBox
HtmlContainerControl
HtmlForm
HtmlGenericControl
HtmlSelect
HtmlTable
HtmlTableCell
HtmlTableRow
HtmlTextArea
HtmlAnchor
HtmlButton
<table>
<form>
<input type=button>
<tr>
<td>,<th>
<input type=text>
<textarea>
<input type=image>
<input type=file>
<input type=hidden>
<input type=radio>
<input
type=checkbox>
<select>
<a>
<span>,
<div>,
<button>
<img>
I. HTML Server Control

Các sự kiện (event) của HTML server Control:

onServerClick

onServerChange

onStartSelect,…
Cú pháp:

Lưu ý:
Function không có tham số
.
<tagName event=“Function_Process”></tagName>
<tagName event=“Function_Process”></tagName>
I. HTML Server Control
Ví dụ:
<input type=“Submit” value=“Gui” id=“btnSend”
runat=“server”onServerClick=“btnSend_ServerCli
ck”/>
I. HTML Server Control

Cách lấy dữ liệu từ các HTML server
Cú pháp:

Đối với tag DIV, SPAN dùng thuộc tính
.innerHTML
controlfield_id.Value
controlfield_id.Value
I. HTML Server Control
Ví dụ:
<script runat=“server”>
public void btnSend_ServerClick(object
sender,System.EventArgs e)
{
String strName;
strName=txtName.Value;
Response.Write(“Hello :”+strName)
}
</script>
Ví dụ
<script runat="server">
void Button_ServerClick(object sender, EventArgs e)
{
MySpan.InnerHtml = “Chao ban : " + myText.Value + ".";
}
</script></head>
<body>
<form id="myForm" runat="server">
<input type="text" id="myText" runat="server"><br>
<input id="Submit1" type="submit" Value="Click Here!"
OnServerClick="Button_ServerClick" runat="server">
<span id="MySpan" runat="server"/><b>
</form>
</body>
II. Web Server Control

Web server control là những tag đặc biệt của
ASP.NET. Các control này được xử lý trên
server và đòi hỏi phải có thuộc tính runat=
“server”

Web server control tồn tại bên trong không
gian tên System.Web.UI.WebControls

Cú pháp:
<asp:controlname id="some_id" runat="server"/>
<asp:controlname id="some_id" runat="server"/>
Hệ thống thứ bậc của Web Server Control
System.Object
System.Web.UI.Control
WebControl
AdRotator
BaseDataList
DataGrid
DataList
Button
Calendar
CheckBox
RadioButton
HyperLink
Image
ImageButton
Label
BaseValidator
BaseCompareValidator
CustomValidator
RangeValidator
RegularExpressionValidator
RequiredFieldValidator
LinkButton
ListControl
RadioButtonList
CheckBoxList
DropDownList
ListBox
Panel
Table
TableCell
TableHeaderCell
TableRow
TextBox
ValidationSummary
Repeater
CompareValidator
Xml
II. Web Server Control
Nhóm control cơ bản

Cú pháp chung:

Các control cơ bản gồm:
<asp:ControlName runat=“sever” id= ‘ControlID”/>
<asp:ControlName runat=“sever” id= ‘ControlID”/>
II. Web Server Control

Label

Textbox

Button

CheckBox and Radio

Image, Hyperlink, Panel

List Controls group

Table

AddRotator

FileUpload

Validation

Không có nhận xét nào:

Đăng nhận xét