@page @model DocumentViewer @{ ViewData["Title"] = "Document Viewer"; Layout = "~/Pages/_Layout.cshtml"; } @using GleamTech.AspNet.Core @using GleamTech.DocumentUltimate @using GleamTech.DocumentUltimate.AspNet @using GleamTech.DocumentUltimate.AspNet.UI Viewer @{ var documentViewer = new DocumentViewer { Width = 800, Height = 600, Document = "~/Documents/Document.docx" }; } @this.RenderBody(documentViewer)
The preceding code looks a lot like a Razor view file used in an ASP.NET Core app with controllers and views. What makes it different is the @page directive. @page makes the file into an MVC action - which means that it handles requests directly, without going through a controller. @page must be the first Razor directive on a page. @page affects the behavior of other Razor constructs. Razor Pages file names have a .cshtml suffix.
@page
@page @using GleamTech.AspNet.Core @using GleamTech.DocumentUltimate @using GleamTech.DocumentUltimate.AspNet @using GleamTech.DocumentUltimate.AspNet.UI @using GleamTech.Examples @using Microsoft.AspNetCore.Mvc.Razor <!DOCTYPE html> @{ var documentViewer = new DocumentViewer { Width = 800, Height = 600, Document = "~/Documents/Document.docx" }; } <html> <head> <title>Document Viewer</title> @((RazorPageBase)this).RenderHead(documentViewer) </head> <body> @((RazorPageBase)this).RenderBody(documentViewer) </body> </html>
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add notify@gleamtech.com to your trusted senders list in your email software.