I have data like below
AAAAAA
BBBBBB
CCCCCC
DDDDDD
EEEEEE
Now there is a button on the page, and when I click the button, the browser would
Yes, you can export the information as a csv file, and give it an Excel file extension. Excel will recognize it's not native Excel format and allows to import with a warning message. For the download, you can search the internet for regular file downloads with a custom MIME type in ASP.NET.
Because of the warning message, the above is not the preferred way. You could also use a library to generate a native Excel file. I've used Aspose.Cells successfully in past projects.