First I would like to talk about downloading the files, in ASP.NET, you can use this following code to let the client download the file.
var file = Server.MapPath("~/documents/" + Request["doc"]);
Response.AppendHeader("content-disposition", "attachment; filename=" + Request["doc"]);
Response.ContentType = "application/octet-stream";
Response.TransmitFile(file);
Then, for viewing the file content there are a lot of methods, if the file is PDF, then you would need to use some PDF reader, if the file is Word document then a Word reader. There are quite a lot of .NET libraries by third-party developers to let you read the content of these files and write them on the screen as simple pain text (but with styles). One of such libraries is
iTextSharp[
^]. There are similar more libraries to let you view the content of files. If you would use iTextSharp, then the following links would help you out.
http://stackoverflow.com/questions/2550796/reading-pdf-content-with-itextsharp-dll-in-vb-net-or-c-sharp[
^]
http://www.schiffhauer.com/read-text-in-a-pdf-in-c-with-itextsharp/[
^]
https://social.msdn.microsoft.com/forums/vstudio/en-US/420e524e-9e2a-4a0a-969d-42284f523f07/read-pdf-using-itextsharp[
^]
There are a lot of other libraries and solution out there. Do remember to Google for them when you need them. :)