Solved

Display logfile on the web server to my client (mvc 3 C# web application)

Posted on 2013-06-19
3
484 Views
Last Modified: 2013-06-21
I have a web application written with C# and mvc application. This app will load an excel file to the database and log the result in a text file. How can I display the log file to my user/client at the end of the load. The log file will just indicate the total number of records loaded.

some code samples will be appreciated.
0
Comment
Question by:Sirdots
  • 2
3 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 39260375
If you know the name of, and the path to, the log file, just store the name and display the list of log files on a page, making each name a link to the log file itself.  If it's just a text file, it should open in any browser.
0
 

Author Comment

by:Sirdots
ID: 39260405
Thanks Paulmacd. Is this possible to be done without the page refreshing. Assuming my user clicks on submit and the upload completes. I will like to show the link to the file at the bottom of my page. Which container do I use to store this link? Literal? Am using mvc.
0
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 39260458
Without using javascript of some sort, I don't know how to do it without a refresh.  Here's some ideas:
http://stackoverflow.com/questions/9035329/update-panel-in-asp-net-mvc-3
http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-8
http://www.vnx.nl/?p=144


As to what container - I don't think it matters.  Anything you can tap for its InnerHTML property should work.  Just put an <a> tag to wherever the log file is located.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question