Asp.Net TextBox Nesnesi Kontrolü - Bilişim Konuları

Asp.Net TextBox Nesnesi Kontrolü

Asp.Net ile textbox kontrolüne örnek bir yazı. Ekrana bir tane textbox eklendikten sonra yine bir buton ile textbox’a girilen ifade label üzerine yazdırılıyor. Visual Studio programında asp.net örneklerini daha kolay bir şekilde yapmaktayız.

Program Kodları:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TextBox.aspx.cs" Inherits="TextBox" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        Adınızı Giriniz
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Yazdır" 
            Width="103px" />
        <br />
        <br />
        <br />
        <br />
        <asp:Label ID="Label1" runat="server" Font-Size="25pt" ForeColor="#FF3300"></asp:Label>
    
    </div>
    </form>
</body>
</html>

Ekran Görüntüsü:

Programın C# kodları:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TextBox : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = TextBox1.Text;
    }
}

Programın çalışan hali:

Bu Yazıya Tepkin Nedir?
+1
1
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Yorum Yap