https://github.com/imaun/iviewrenderer
Write view contents directly to the Http Response
https://github.com/imaun/iviewrenderer
Last synced: 7 months ago
JSON representation
Write view contents directly to the Http Response
- Host: GitHub
- URL: https://github.com/imaun/iviewrenderer
- Owner: imaun
- License: gpl-3.0
- Created: 2019-12-11T06:27:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-11T07:30:56.000Z (about 6 years ago)
- Last Synced: 2025-03-05T23:40:59.343Z (10 months ago)
- Language: C#
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iViewRenderer
Write view contents directly to the Http Response
## How to use :
Install IViewRenderer package from nuget
```
Install-package imun.Http.iViewRenderer
```
First of all inject IViewRenderer to your Controller.
Sample usage :
```c#
IViewRenderer _viewRenderer;
await _viweRenderer.RenderViewAsync(this, "viewName", Model);
```
This will render your view directly to the Http Response.
If you want to get a View that has a Model as string then :
```c#
await _viweRenderer.GetViewAsStringAsync(this, "viewName", model);
```
This will use your model to populate View and then return it as string.