Total Page Preview: 000000007281
What is linkbutton in ASP.NET in English and Hindi
Linkbutton in ASP.NET in English
In ASP.NET, LinkButton is a control that looks like a hyperlink but behaves like a button. When a user clicks on a LinkButton, it can perform an action on the server, such as redirecting to another page, performing a database operation, or running server-side code.
Here is an example of how to use a LinkButton in ASP.NET:
In this example, we have a LinkButton control with an ID of "myLinkButton". The runat="server" attribute tells ASP.NET that this control should be processed on the server, and the Text attribute sets the text that will be displayed on the button.
We also have an OnClick attribute that specifies the name of a method that will be called when the button is clicked. Here is an example of what the method might look like:
In this example, we have a method called "myLinkButton_Click" that takes two parameters: sender and e. These parameters are automatically passed to the method by ASP.NET when the button is clicked.
Inside the method, we can perform any server-side operation that we want, such as updating a database, retrieving data from a web service, or performing some other task. In this example, we are using the Response.Redirect method to redirect the user to another web page.
LinkButton control is a useful tool for creating clickable elements that can perform actions on the server. It can be used to create navigation menus, buttons, and other interactive elements on a web page.
Linkbutton in ASP.NET in Hindi
ASP.NET me, LinkButton ek control hota hai jo hyperlink ki tarah dikhta hai lekin button ki tarah behave karta hai. Jab user LinkButton par click karta hai, to isse server par action perform kiya ja sakta hai, jaise ki dusri page par redirect hona, database operation perform karna ya server-side code run karna.
Yahan ek LinkButton ka example hai:
Is example me, humne LinkButton control ka use kiya hai jiska ID "myLinkButton" hai. runat="server" attribute batata hai ki ye control server par process kiya jana chahiye, aur Text attribute button par display hone wala text set karta hai.
Humne OnClick attribute ka use kiya hai jo ek method ka naam specify karta hai jo button click hone par call hoga. Yahan ek example diya gaya hai ki method kaisa ho sakta hai:
Is example me, humne "myLinkButton_Click" naam ka ek method banaya hai jisme do parameters hain: sender aur e. Ye parameters ASP.NET dwara LinkButton click hone par automatically method ko pass kiye jate hain.
Is method ke andar, hum koi bhi server-side operation perform kar sakte hain, jaise ki database update, web service se data retrieve karna ya koi aur task perform karna. Is example me, hum Response.Redirect method ka use kar rahe hain jisse user ko dusri web page par redirect kiya ja sake.=
LinkButton control clickable elements banane ke liye ek useful tool hai jo server par actions perform karne ke liye use kiya ja sakta hai. Isse navigation menus, buttons aur dusre interactive elements banane me help milti 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