servicestack-razor

ServiceStack Razor with Multiple SPAs

不羁的心 提交于 2020-01-05 06:26:27
问题 I don't see an example of using ServiceStack Razor with Multiple SPAs on the internet. The reason for having multiple SPAs in my use case is because my entire site is quite huge and I would like to modularize my site with multiple SPAs. I am aware of the FallbackRoute attribute but it seems to only allow one FallbackRoute based on the documentation? I would like to have, for example, these routes in my app that routes to their respective SPA www.mydomain.com/spa1/... www.mydomain.com/spa2/...

Servicestack with Razor not working -> FORBIDDEN ressource

让人想犯罪 __ 提交于 2019-12-25 07:25:54
问题 I'm loosing my mind ... wanna use SS Razor feature in an empty web application on my Win 8.1 machine. Installed via NuGet, added a webpage at the root and get this error: >Forbidden >Request.HttpMethod: GET >Request.PathInfo: /default.cshtml >Request.QueryString: >Request.RawUrl: /default.cshtml >App.DebugLastHandlerArgs: >GET|/default.cshtml|Z:\GIT\MasterThesis\src\AppBlue\AppBlue.Web\default.cshtml I also tried the Razor rockstars sample app from SS - this works perfectly. So I've copied

ServiceStack not rendering Razor View, only seeing Snap Shot

a 夏天 提交于 2019-12-13 15:23:21
问题 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 "ServiceStack ASP.Net with Bootstrap" Open Nuget Server Console to download misssing Servicestack Packages. Build. Renamed Services.cs to MyStuffServices.cs and Model.cs to MyStuffModel.cs Added to 'AppHost.cs': SetConfig(new HostConfig {

ServiceStack renders RequestBindingException via Razor template

只愿长相守 提交于 2019-12-12 03:28:25
问题 I have a simple DTO with just an Int inside: [Route("/cells/{Id}")] public class CellDetail { public int Id { get; set; } } Using a URL like /cells/abc gives med a RequestBindingException in JSON, but the HTML view is still rendered via my .cshtml file, which obviously fails due to @Model == null. Shouldn't it give a HTML error page instead? How does it even know which .cshtml view to select? 回答1: The Razor Page lets you access the Error Info about the Request in: object ModelError { get; } /

ServiceStack Razor files in separate project

半城伤御伤魂 提交于 2019-12-11 13:32:29
问题 I have a solution consisting of a ServiceStack back-end, with the regular setup (AppHost, ServiceInterface and ServiceModel), and both a winforms app and a iOS app consuming services. Now I'd like to make a web-admin, and am looking for advice on how to structure this . I'd like to keep the apphost project small, as SS docs say Ideally the root-level AppHost project should be kept lightweight and implementation-free. So I'd like to have the web-admin in a separate project , with all the

Service Stack 4.0.15: Razor Partial not outputted inside @section

﹥>﹥吖頭↗ 提交于 2019-12-11 12:54:15
问题 Summary: Razor Partials don't get rendered inside a @section in ServiceStack 4. This seems to be a bug in ServiceStack.Razor. Version: ServiceStack 4.0.15 Affected Package: ServiceStack.Razor Razor partials inside a section does not get rendered. Example Inside _Layout.cshtml @RenderSection("JavascriptConfig", required: false) Inside home.cshtml @section JavascriptConfig { @Html.Partial("_routes", Model.Lang) } Inside _routes.cshtml @model string test If I look at the source code of the