In this article we will learn how to export GridView records or data table to XML using ASP.Net C#.
Background
Now the default.aspx source code will be such as follows:
Now let us create a function to bind the records to the Grid view from the database. If you are a beginner and don't understand in detail how to bind a Grid view from a database then refer to my following article.
Now, for this article create the following function in the default.aspx.cs page to bind the Grid view:
Diving Into ASP.NET WebAPI