Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > C# (.NET) > ASP.NET HTML & Form > (C#) ASP.NET Web Control & HTML Control



Clound SSD Virtual Server

(C#) ASP.NET Web Control & HTML Control

(C#) ASP.NET Web Control & HTML Control ในภาษา ASP.NET ตัว Web Control และ HTML Control หน้าตาบางตัวจะเหมือนกัน แต่ทำงานต่างกันสิ้นเชิงครับ เพราะ Web Control จะถูกทำงานและควบคุมได้จากฝั่ง Web Server สามารถกำหนด Properties หรือ Attribute ได้ แต่ในส่วนของ HTML Control จะทำงานที่ฝั่ง Client และทำการส่ง Request ให้กับ Web Server อีกทีครับ

Language Code : VB.NET || C#

Syntax

- Web Control
<asp:Control id="[Name]" runat="server"></asp:Control>
- HTML Control
<input id="Name" name="Name" type="text" />
<input id="Name" name="Name" type="radio" />
...



MyFile.aspx (C#)

<%@ Page Language="C#" %>
<script runat="server">
	void Page_Load()
	{
		this.lblText1.Text = "Please input Name ";
	}

    void btnSubmit_OnClick(Object sender, EventArgs e)
    {
        this.lblName.Text = this.txtName.Text;
        this.lblSurname.Text = this.txtSurname.Text;
        this.lblFullName.Text = Request.Form["txtFullName"];
    }

</script>
<html>
<head>
</head>
<body>
    <form runat="server">
        <asp:Label id="lblText1" runat="server" text="Name"></asp:Label>
        <asp:TextBox id="txtName" runat="server"></asp:TextBox>
        <asp:Label id="lblText2" runat="server" text="Surname"></asp:Label>
        <asp:TextBox id="txtSurname" runat="server"></asp:TextBox>
        <br />
        <span><label>FULL</label></span>
        <input id="txtFullName" name="txtFullName" type="text" value="<%=Request.Form["txtFullName"]%>" />
        <asp:Button id="btnSubmit" onclick="btnSubmit_OnClick" runat="server" Text="Submit"></asp:Button>
        <hr />
        <asp:Label id="lblName" runat="server"></asp:Label> <asp:Label id="lblSurname" runat="server"></asp:Label>
        <br />
        <asp:Label id="lblFullName" runat="server"></asp:Label>
    </form>
</body>
</html>



คำอธิบาย

จากตัวอย่างจะเห็นว่า Web Control ชื่อ lblText1 สามารถถูกควบคุมได้จากฝั่ง Web Server ซึ่งแตกต่างกับ HTML Control ที่สามารถทำการอ่านค่าได้จาก Request

Screenshot

ASP.NET HTML


ASP.NET HTML Controls

ASP.NET Web Controls






   
Share


ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2008-11-03 10:43:10 / 2009-06-02 16:40:22
  Download : No files
 Sponsored Links / Related

 
(C#) ASP.NET & HTML
Rating :

 
(C#) ASP.NET runat="server"
Rating :

 
(C#) ASP.NET Tag Form
Rating :

 
(C#) ASP.NET Web Control & HTML Control
Rating :


ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   







Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่