Questions tagged [servicestack-razor]

Razor ViewEngine support for the ServiceStack web services framework

54 questions
8
votes
0 answers

Structure for combined ServiceStack services and website

With Razor support, ServiceStack is a complete framework for creating both REST-services and websites. When making both a website and services, how would you structure this? Not unnecessarily complex, but with an option to scale when the codebase…
specimen
  • 1,735
  • 14
  • 23
4
votes
1 answer

Servicestack razor page is getting added to content

I am trying to use Servicestack with F#. So, far I am successful. But while trying to pull thing up with asp.net hosting using razor engine. I come across weird issue. If for default.cshtml I choose property that do not copy with compilation with…
kunjee
  • 2,739
  • 1
  • 23
  • 38
3
votes
1 answer

ServiceStack SharpScript Future

Good day, I've been using ServiceStack for many years, I currently designing and planning a rewrite of an ASP MVC (Razor) project. #Script seems to be an almost perfect fit, without hands-on experience of the technology I have some doubts and…
Francois Taljaard
  • 1,339
  • 2
  • 12
  • 33
3
votes
1 answer

ServiceStack Render Razor Fails to Find View

This is a self hosted project. There is a Views\Member.cshtml file that is set to copy always as content. The following when run returns null for the razorView. I seem to be missing something here. var razorView = razor.GetViewPage("Member");…
lucuma
  • 18,247
  • 4
  • 66
  • 91
3
votes
1 answer

Is there a YSOD in ServiceStack for Unhandled Exceptions?

Is there a built-in renderer for unhandled exceptions when using the RazorFormat plugin? Our service is throwing an exception, but ServiceStack is rendering the corresponding Razor view anyway (just with empty data). I would have expected Razor to…
Sebastian Nemeth
  • 5,505
  • 4
  • 26
  • 36
2
votes
2 answers

How to use ServiceStack Templates to support dynamic results based on request type?

With ServiceStack's Razor Story we have a variety of ways of selecting which Razor View we want to use to render a page. Even better, and critical in my case, is we can pass in a Content-Type header (or query string parameter, or even page…
jklemmack
  • 3,518
  • 3
  • 30
  • 56
2
votes
0 answers

Servicestack: GlobalHtmlErrorHttpHandler

I have a global html error handler setup like this: public override void Configure(Container container) { //... this.GlobalHtmlErrorHttpHandler = new RazorHandler("/oops"); this.ServiceExceptionHandlers.Add((httpReq, request, exception)…
Ermias Y
  • 263
  • 2
  • 11
2
votes
1 answer

ServiceStack InMemoryVirtualPathProvider for Razor - GetViewPage null

I tested this with the default out of the box implementation and GetViewPage retrieves the view from the file system without a problem. I swapped out the RazorFormat's VirtualFileSource for the inmemory one: Plugins.Add(new RazorFormat() { …
lucuma
  • 18,247
  • 4
  • 66
  • 91
2
votes
1 answer

ServiceStack Razor Views from Multiple Module Directories

I am starting a new project in which the idea is to organize the project file/folder structure in to different modules (.csproj) and finally once deployed these modules would be loaded to one AppHost of MainModule (these sub modules would act as…
Basant Sahu
  • 321
  • 2
  • 7
2
votes
1 answer

ServiceStack not rendering Razor View, only seeing Snap Shot

I've set up a very basic ServiceStack project with Bootstrap and I'm trying to get it to see my homepage (Razor View) which it doesn't, so I get the Snapshot of my homepage. Here are the steps I take to create the project: Create new Project…
2
votes
1 answer

Does ServiceStack support POSTs from plain html?

It is basically does, but I have a problems with national symbols in the POST data. They are came corrupted to the Service. I have very basic markup:
2
votes
1 answer

ServiceStack UK Date Binding on HTTP POST

I am using a mono self hosted servicestack application with the ServiceStack.Razor rendering. In the application the user enters into a form a UK date (dd/mm/yyyy) but this is converted to a US date (mm/dd/yyyy) on a HTTP POST. In a normal MVC…
Ollie
  • 1,140
  • 8
  • 26
2
votes
1 answer

ServiceStack.Html Custom Label Extensions

I have been trying to work out how to register a label extension class into a ServiceStack.Html / Razor project. I am using the "Stand-alone, self-hosted HttpListener" option but I cannot work out how to register or use new @Html extension for use…
Ollie
  • 1,140
  • 8
  • 26
1
vote
1 answer

Creating Google Sign In Authentication in Service Stack

I know Service Stack offers a plugin to incorporate google sign in but we are on old version of service stack so we are creating the flow ourselves. We have a custom CredentialsAuthProvider where we are overriding TryAuthenticate and other methods…
Learn AspNet
  • 1,192
  • 3
  • 34
  • 74
1
vote
2 answers

Add custom headers to ViewEngine response pages in ServiceStack

I am using ServiceStack with SharpPages to render dynamic content. For "reasons", I need to set the CORS headers Access-Control-Allow-Origin and Access-Control-Allow-Credentials, supporting multiple subdomains. My SharpPages feature is enabled with…
jklemmack
  • 3,518
  • 3
  • 30
  • 56
1
2 3 4