dotvvm | Open source MVVM framework for Web Apps | DevOps library
kandi X-RAY | dotvvm Summary
kandi X-RAY | dotvvm Summary
. Component-based MVVM framework for ASP.NET.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dotvvm
dotvvm Key Features
dotvvm Examples and Code Snippets
Community Discussions
Trending Discussions on dotvvm
QUESTION
I'm trying to create an ApplicationUser
which has a User
as a child object, this is what the models look like:
ApplicationUser:
...ANSWER
Answered 2020-Jul-01 at 01:11I'm almost sure that you're using .OwnsOne wrong (but i doubt it is root cause, i speak about it later) Owned types are Value objects. Value objects have no identity on their own and exist only as a part of their owner like
QUESTION
I'm trying to change a CssStyle property, 'background-color', from a Panel component programmatically through a Button click Command, but nothing happen. If I set the property on ViewModel Load() method, works. After page loads don't.
DefaultViewModel class scope:
...ANSWER
Answered 2019-Nov-04 at 11:06DotVVM does not work this way, controls don't have any state and thus manipulating them in commands does not make much sense. Controls in DotVVM are just thin wrappers around the HTML that is sent to the client on the first request. Since no HTML is generated on commands, modifications of the controls don't propagate to the browser (except when you use Postback.Update
property on the control)
You want to store the state in your view model and then data bind it to the control. I'm not sure what exactly you want to do so let's suppose you want to highlight a div
in some cases. The markup (in dothtml file) could look like this:
QUESTION
I'm trying to color rows in the GridView
based on the state (Enum
value) of underlying item in the row, but none of the solutions I've found in docs seems appropriate for me.
I have DataSource
like this for the GridView
ANSWER
Answered 2019-Aug-20 at 12:40The BootstrapColor
enum should be treated as a presentation layer thing. You are right that it's not wise to use it in internal microservices or in lower layers of the application.
The DTO that comes from the lower layer should contain the information about what's going on, without caring about how it will be displayed to the user. I would expect an enum with values like Paid
, Unpaid
, Canceled
etc., or alternatively set of bool
flags - IsPaid
, IsCanceled
and so on.
In the presentation layer, you have two options:
Project the DTO to another DTO (either manually, or using AutoMapper for example) which will contain the
BootstrapColor
enum value.Use expressions in DotVVM data-bindings to make the transform in the markup.
For simple cases, I would choose the second option.
The correct syntax for is this:
QUESTION
I'm trying to view PDF in a browser tab using DotVVM.
I've tried to use ReturnFile()
method described here https://www.dotvvm.com/docs/tutorials/advanced-returning-files/1-1
with additionalHeaders
but it haven't worked.
ANSWER
Answered 2019-Aug-01 at 07:25In DotVVM 2.3.0, we have added an overload ofReturnFile
which allows to specify Content-Disposition
header. If you set it to inline
, it should display the document instead of downloading it.
QUESTION
I’ve created a DotVVM Core 2.0 project using Visual Studio and I have activated a trial version of Business Pack that I have added into that project from the private feed. I have registered the Business Pack in DotvvmStartup.cs in ConfigureServices. I don’t see bp controls in IntelliSense and when I try to run web app with the bp controls I get an error that tagprefix was not registered.
I use latest version of Visual Studio 2017 Community and latest versions of DotVVM and Business Pack. Thanks for any advice.
...ANSWER
Answered 2018-Dec-20 at 13:37Perhaps you won't call method
DotvvmStartup.ConfigureServices
. It is cause by "bug" in VS2017 extension template (v2.0.118.0 and below) and dotnet CLI template (dotvvm.templates.2.0.3).
Please check Startup.ConfigureServices
.
QUESTION
I want to implement the MVVM Light INavigationService
interface in a DotVVM project; but I don't know how to do that. The most important method that I need to implement is NavigateTo(string pageKey)
method.
I am using a SpaContentPlaceHolder
in my MasterPage
and I want to change the content (RouteName) of the SpaContentPlaceHolder
by calling the NavigateTo
method.
ANSWER
Answered 2018-Nov-18 at 14:03If you are in the viewmodel, you can just call Context.RedirectToRoute("YourRoute", new { Param1 = something })
.
If you want to redirect from a different place, the easiest way is to create INavigationService
interface and implement it to call the method on IDotvvmRequestContext
(which is already registered in the ASP.NET Core dependency injection container):
QUESTION
Is there a way how to use value binding in
Putting all together this is what i get when i open the page:
...ANSWER
Answered 2018-Jul-13 at 13:20Value bindings don't work in script
elements - they are translated to Knockout JS expressions (the HTML comments you have in the code snippet).
You have two options:
Use resource binding:
{{resource: ChartLabels}}
You need to do all the conversions so it will produce a valid JavaScript expression - it just renders a string in the output HTML.You may use JavaScript to get the values directly from the viewmodel:
QUESTION
i have this class
...ANSWER
Answered 2018-Jun-19 at 09:00DotVVM does not assign to the property usning the setter, is sets the underlying property store in DotvvmBindableObject
instead. It's very simmilar what WPF does with their DependencyProperty
, it's needed to represent the data bindings. You can actually completely omit the C# property declaration, declaring the field TextProperty
and calling the DotvvmProperty.Register is enough to declare a property for dotvvm.
Other "problem" is that the controls do not store any data, everything has to be persisted in the view model. You can only use the control properties to data-bind a view model property. I think we are running here into a XY problem, I can only tell why your code does not work, but I have no idea what are actually trying to do...
Anyway, if you just want to "bind" your control to a view model property, have a look at https://www.dotvvm.com/docs/tutorials/control-development-markup-controls-with-code/2.0. You can declare the property like that:
QUESTION
I am trying to make some dynamic logic for our application, but component don't want to cooperate.
This is masterpage ViewModel:
...ANSWER
Answered 2017-Jul-21 at 12:01You bind Alert type to AlertType property which you set in viewmodel Init only. So when you change AlertComponent later, you didn't setup AlertType.
Or you can use a litle trick
QUESTION
With the latest release of ASP.NET CORE version 2.0 we now have Razor Pages which I really like because it shows a MVVM way of developing which I am already familiar because I've used it in UWP.
I was searching to develop web apps without js because I am a .net developer and I came across this framework known as DOTVVM , it is great because it gives some features of js frameworks like angular, react e.t.c and it also integrates very well with ASP.NET CORE 2.0
I want to discuss this between following 3 scenarios :
I should use DOTVVM and dont use js at all.
I should use razor pages instead with asp.net core 2.0, because razor pages provide all functionality which dotvvm provides and it will have more community in future.
I should learn a **js framework ** like angular or react because neither razor pages, nor dotvvm is enough powerful to replace them.
The discussion can be from point of view of all developers, so I can get opinion of js developers as well as those who have worked with dotvvm or razor pages. The aim is to create completely interactive and responsive web app with good performance.
Important : ** the web app created can be a **progressive web app from the start or maybe turned into a pwa after creating it, depends on the technology I choose at the end.
I know for a progressive web app I will need to write a little js, but that is alright considering that is very simple and little to write.
The reason of this question is so that we can discuss these options from multiple perspectives and deduce a better option at the end for my app.
Thanks in advance.
...ANSWER
Answered 2017-Oct-04 at 08:58It really depends on the type of the application you are trying to create. The fact is that you can build any application in any web technology. The difference is only in how difficult it would be.
Razor Pages are very easy to use and they are part of ASP.NET Core platform. They are using the MVVM pattern, but they are not helping with client interactivity. If you need to hide some form field based on some condition, you would need to do it in JavaScript.
I would use them for a simple company website, very simple admin sites with few pages and trivial forms, or for a public facing part of some eCommerce site. I would probably use also jQuery or other libraries to do the interactivity, animations and things like that.
DotVVM is an MVVM framework which helps especially with web applications with complicated UI: lots of complex forms with dozens of fields and interactivity (when you select an item in a combobox, another combobox will get new values, some fields will be pre-filled, a part of the form will disappear or change and so on). Modal dialogs, multi-step wizards, lots of grids with data, sorting, paging...
Because DotVVM handles many things for you and translates the data-bindings to JavaScript, you don't need to write the JS yourself. It doesn't mean that you should not learn it. It will help you a lot if you know it - you will be able to add even more interactivity, extend the framework when you need it and more. DotVVM lets you do quite a lot without knowing JS, but you will get much further if you know it.
Angular, React or other client-side frameworks are used widely today and many websites and applications are built in that. They are more universal than DotVVM, which aims primarily at the business app segment and requires .NET on the server (because it is not only the client-side library).
Using Angular or React requires the knowledge of JavaScript, and not only that. You will need to know Node.js and the related tooling, like npm. You will need to exchange data with the server, so you will need to build probably a REST API, use Swagger to generate the client-side proxy classes, and then you will probably need some other JS libraries with controls and things like that.
It is quite a lot of things to learn and if you are used to the comfort of Visual Studio, like the IntelliSense or the debugger, you will miss these features for sure.
And finally, you don't need to stick to one technology. You can combine Razor Pages with DotVVM for example. You can make the admin dashboard in DotVVM and the public part of the website in Razor Pages.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dotvvm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page