Total Page Preview: 000000000954
What is textbox in ASP.NET in English and Hindi
Textbox in ASP.NET in English:
In ASP.NET, a textbox is a standard control used to capture user input. It allows users to enter text data, such as their name, email address, or any other information required by an application.
Here's an example of how to create a textbox in ASP.NET using C# code:
In the code above, the asp:TextBox tag is used to create a textbox control with the ID txtName. The runat="server" attribute is required to make the control accessible on the server-side.
You can access the value of the textbox in the code-behind file using the Text property of the control. Here's an example of how to retrieve the value of the txtName textbox:
In the code above, the Text property is used to retrieve the value entered by the user in the txtName textbox, and assign it to the name variable.
Textbox in ASP.NET in Hindi:
ASP.NET mein, "TextBox" ek Web Forms Control hai, jo ek user interface element hai jisko aam taur par input field ya text field ke roop mein jaana jaata hai. TextBox, web application mein user input ke liye use kiya jaata hai, jaise ki form input fields, search boxes, user login details, etc.
Yahan ek example diya ja raha hai jisme TextBox control ka use kiya gaya hai
Is example mein, ek simple form diya gaya hai jisme 2 TextBox controls hai - "txtName" aur "txtEmail". "btnSubmit" button control, jab click kiya jata hai, ye TextBox ki values ko submit karne ke liye use kiya jaata hai.
TextBox ka use code-behind mein bhi kiya ja sakta hai, jisse code-behind se TextBox ki values ko access kiya ja sakta hai. Yahan ek example diya ja raha hai, jisme TextBox ki value page load event mein display ki ja rahi hai:
Is code-behind example mein, Page_Load event mein "txtName" TextBox control ka value set kiya ja raha hai. btnSubmit_Click event mein, "txtName" aur "txtEmail" TextBox controls se value retrieve kiya ja raha hai, jise fir code mein further processing ke liye use kiya ja sakta hai.
Thank You
About Author
Brijesh Kumar
Database Developer
I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL
Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall
and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com