ASP.NET MVC
|
<< Click to Display Table of Contents >> Navigation: Gnostice Document Studio .NET > Going Deeper > Document Viewing > ASP.NET > Displaying server-side documents > ASP.NET MVC |
Steps to load the document from server in an ASP.NET MVC application is listed as follows.
1.Setup a simple document viewer control in ASP.NET MVC application as explained in the Getting Started section.
2.Copy input document to App_Data folder in your application.
3.In the controller class, add/replace the below method
public ActionResult Index() new Gnostice.Controls.ASP.ViewerController();
|
This method is invoked before loading the webpage. Here ViewerController is initialized and the document is loaded through ViewerController.
4.In client side, add below JavaScript code snippet to <body> section of view page to load the document
<script type="text/javascript">
|
The above JavaScript method is invoked when the web page is ready to view the document in the viewer. The document is loaded by using the document URI sent by the controller.
5.Run the application in your favorite browser.