title: How to use GroupDocs Viewer for .NET in an ASP.NET MVC Project?
body: <p>I get install GroupDocs Viewer in my project.</p>
  
  <p>and in global</p>
  
  <pre><code> Groupdocs.Web.UI.Viewer.InitRoutes();
   Groupdocs.Web.UI.Viewer.SetRootStoragePath(Server.MapPath("~/DietTemplate/"));
  </code></pre>
  
  <p>and in controller</p>
  
  <pre><code>var ByteStream = new FileStream(Server.MapPath("~/DietTemplate/L0.docx"),
  FileMode.Open, FileAccess.Read, FileShare.Read);
  //ViewData
  ViewData["stream"] = ByteStream;
  ViewData["filename"] = "L0.docx";
  ViewData["extension"] = "docx";
  ViewData["fileDisplayName"] = "Defined document.pdf";
  return View();
  </code></pre>
  
  <p>and in view</p>
  
  <pre><code>@section Styles{
  @Html.CreateViewerScriptLoadBlock().LoadJquery().LoadJqueryUi() 
  }
  
  @(Html.ViewerClientCode()
      .TargetElementSelector("#test")
      .Stream(ViewBag.Stream,
  ViewBag.Filename,
  ViewBag.Extension,
  ViewBag.FileDisplayName)
      .ZoomToFitWidth()
  )
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>add script in view </p>
  
  <pre><code>&lt;script type="text/javascript"&gt; $(function () { var localizedStrings = null;var thumbsImageBase64Encoded = null;$('#test').groupdocsViewer({ localizedStrings: localizedStrings, thumbsImageBase64Encoded: thumbsImageBase64Encoded, filePath: 'temp\\S\\L0.docx',quality: 100,showThumbnails: true,openThumbnails: true,initialZoom: 100,zoomToFitWidth: true,onlyShrinkLargePages: false,zoomToFitHeight: false,width: 0,height: 0,backgroundColor: null,showFolderBrowser: true,showPrint: true,showDownload: true,showZoom: true,showPaging: true,showViewerStyleControl: true,showSearch: true,preloadPagesCount: null,preloadPagesOnBrowserSide: false,convertWordDocumentsCompletely: false,viewerStyle: 1,supportTextSelection: true,usePdfPrinting: false,toolbarButtonsBoxShadowStyle: null,toolbarButtonsBoxShadowHoverStyle: null,thumbnailsContainerBackgroundColor: null,thumbnailsContainerBorderRightColor: null,toolbarBorderBottomColor: null,toolbarInputFieldBorderColor: null,toolbarButtonBorderColor: null,toolbarButtonBorderHoverColor: null,thumbnailsContainerWidth: 0,jqueryFileDownloadCookieName: 'jqueryFileDownloadJSForGD',showDownloadErrorsInPopup: false,showImageWidth: false,showHeader: true,minimumImageWidth: 0,enableStandardErrorHandling: true,useHtmlBasedEngine: false,useHtmlThumbnails: false,useImageBasedPrinting: true,fileDisplayName: 'Defined document.pdf',downloadPdfFile: false,searchForSeparateWords: false,preventTouchEventsBubbling: false,useInnerThumbnails: false,watermarkText: null,watermarkColor: null,watermarkPosition: 'Diagonal',watermarkFontSize: 0,printWithWatermark: false,supportPageReordering: false,searchHighlightColor: null,currentSearchHighlightColor: null,treatPhrasesInDoubleQuotesAsExactPhrases: false,usePngImagesForHtmlBasedEngine: false,showOnePageInRow: false,loadAllPagesOnSearch: false,useEmScaling: false,ignoreDocumentAbsence: false,supportPageRotation: false,useRtl: false,useAccentInsensitiveSearch: false,useVirtualMode: false,supportListOfContentControls: false,supportListOfBookmarks: false,embedImagesIntoHtmlForWordFiles: false}); }); &lt;/script&gt;
  </code></pre>
  
  <p>but don't show anything. :(</p>