Save Data from GridView to DataTable using C#

In this article, we will learn how to loop through the rows of GridView using For Each loop while inserting new rows to DataTable using C#. Insert Data from GridView to DataTable in C# First, add a GridView and a button to your web page: <div> <asp:GridView ID="gv" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField DataField="CustomerId" HeaderText="Customer Id"... » read more

Asp.Net: Bind GridView using ViewState and Datatable

In this article, we will learn how to save a DataTable in ViewState and bind it to a GridView. In case, a new record is being added, the DataTable is fetched from the ViewState, updated, and used again to bind the GridView. Bind GridView using Datatable and ViewState using ASP.NET DataTable represents a single in-memory... » read more

ASP.NET GridView: Sort data using column headers

How to sort data in ASP.NET GridView using column headers GridView is a powerful data grid control which allows us to display the values of a data source in a table format where each column represents a field and each row represents a record. The GridView control lets you select, sort, or edit these data... » read more

ASP.Net DropDownList Filter and Search items using JavaScript

In this article, we will learn how to create, search, and filter a DropDownList control in Asp.Net as using JavaScript. Filter and Search ASP.Net DropDownList items using JavaScript Fist, let start by creating a WebForm, then add controlse to it as shown below: <div> <asp:TextBox ID="txtFilter" runat="server" onkeyup="FilterDDL(this.value)"></asp:TextBox><br /> <asp:DropDownList ID="ddlColors" runat="server"> <asp:ListItem Text="Black" Value="1"></asp:ListItem> <asp:ListItem... » read more

A simple ASP.NET login system using C#

In this article, we will learn how to create a simple user authentication system in Asp.Net using C#. The user’s credentials will be saved in the database and will be retrieved to verify the login information. Create a login module using ASP.NET In this tutorial, The login system consists of two pages. Login Page: Login.aspx... » read more

ASP.NET GridView RowUpdating event using C#

In this article, we will learn how to use the RowUpdating event of GridView in Asp.Net using C# with an example. This example takes advantage of GridView control and perform edit and update operations on data and save the changed data in the database. RowUpdating event in the GridView in Asp.Net using C# Let’s get... » read more

Asp.Net GridView: Insert, Update, and Delete data using C#

Overview of CRUD operations using ASP.NET GridView Crud operation ( create, read, update, and delete) is another term of the Select, Insert, Update, and Delete actions. In this example, we will use a simple database table to perform these operations from an ASP.NET GridView. Let’s get started by creating the database and the table. The Database... » read more

ASP.NET Search GridView on TextChanged Event Using C#

In this article, we will learn how to search and filter the GridView by using a TextBox. The OnTextChanged event handler will fire when TextBox gets changed. To use the Text changed event you need to add the related event handler in your code and set the AutoPostBack to true through HTML. How to Search... » read more

ASP.NET MVC upload multiple files

In this article, we will learn how to upload multiple files using Asp.Net MVC and HTML 5. Upload multiple files using ASP.NET MVC HTML5 allows you to select and upload multiple files at the same time. Once the files are uploaded, you can process these using Asp.NET MVC. The view contains an HTML form with... » read more

ASP.Net MVC ViewData: Explaining ViewData with examples

You are wondering what is a viewData in MVC? In this tutorial, you will learn about ViewData objects and how we use them in ASP.NET Applications. What is ViewData in ASP.NET MVC? ViewData is an instance of the ViewDataDictionary class and is used to transfer data from the controller to view. It can be accessed... » read more

JavaScript Disable browser’s back button in ASP.Net

Web browsers enable users to go back to the previous page while browsing the internet by clicking on the back button. But sometimes, you need to prevent the user from visiting the previous page. You might want to disable the browser’s back button but you can’t disable the functionality through the code in the web... » read more