none
i cant get textbox's text property in aspnet web forms RRS feed

  • Question

  • this is my aspx page.

    <%@ Page Title="" Language="C#" MasterPageFile="~/admin.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="KategoriEkle.aspx.cs" Inherits="Admin.KategoriEkle" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <br />
        <div class="col-md-5">
            <div class="widget">
                <div class="widget-heading">
                    <h3 class="widget-title">Kategori Ekle</h3>
                </div>
                <div class="widget-body">
    
                    <div class="form-group">
                        <label for="txtKategoriAdi">Kategori Adi :</label>
                        <asp:TextBox ID="txtKategoriAdi" CssClass="form-control" runat="server"></asp:TextBox>
                    </div>
                    <%--<div class="form-group">
                        <label for="txtPhoneNumber">Ana Kategori : (varsa)</label>
                        <asp:DropDownList ID="drpAnaKategori" CssClass="form-control" runat="server"></asp:DropDownList>
                    </div>--%>
                    <div class="text-right">
                        <asp:Button ID="btnKaydet" runat="server" Text="Kaydet" UseSubmitBehavior="false" CssClass="btn btn-outline btn-success" OnClick="btnKaydet_Click" />
                    </div>
                    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                </div>
            </div>
        </div>
    </asp:Content>

    and this is my code behind .

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using ClassDB;
    
    namespace Admin
    {
        public partial class KategoriEkle : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
               
            }
    
            protected void btnKaydet_Click(object sender, EventArgs e)
            {
                Label1.Text = txtKategoriAdi.Text;
    
            }
        }
    }

    but if i run this project and fill textbox and click button i cant see textbox's text in label . can the master page cause this?

    Thursday, January 25, 2018 7:48 PM

All replies

  • Hi abkucuk,

    Thank you for posting here.

    According to your description is more related to ASP.NET, you could post a new thread in ASP.NET Forum for suitable support.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Saturday, January 27, 2018 6:21 AM