Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Stanislav Lukeš
    @exyi
    In the second case, I don't see any event, but you can register a global postback handler (in dotvvm.globalPostbackHandlers) that will do that (on all requests, you can't know if it's a command or staticCommand)
    Stanislav Lukeš
    @exyi
    the handler could look like this:
    execute: async function (callback, options) {
        var commitFn  = await callback()
        return async function() {
            var resultArgs = await commitFn()
            // executed after it's done
            return resultArgs
         }
    }
    Unfortunatelly, I don't think we can change that behavior due to backward compatibility. Maybe we could for v3.0
    PawelSzpytma
    @PawelSzpytma
    @exyi OK Thanks, i do this in another case.
    Lubos
    @tatran_twitter
    Morning ;-) I am trying to webgrab a page and save the HTML, but resulting HTML does not contain dynamic data... any tip? Code that I am using and works fine with other live websites:
    var WebClient = new System.Net.WebClient();         
    var strSource = WebClient.DownloadString(URL);
    WebClient.Dispose();
    Lubos
    @tatran_twitter
    I guess, this article might help to solve the above problem: https://www.dotvvm.com/docs/tutorials/basics-server-side-html-generation/2.0
    Lubos
    @tatran_twitter
    What property do I need to set to open link in new browser TAB?
    Context.RedirectToUrlPermanent(url);
    Stanislav Lukeš
    @exyi

    @tatran_twitter

    What property do I need to set to open link in new browser TAB?
    Context.RedirectToUrlPermanent(url);

    You can't do that from the server. However, if you are just trying to open a link, there is probably no reason to do that by postback and you can use standard HTML stuff <a target="_blank" rel="noopener noreferrer" ...

    Stanislav Lukeš
    @exyi

    I am trying to webgrab a page and save the HTML, but resulting HTML does not contain dynamic data...

    Are you trying to save a thirt-party DotVVM page? Or your DotVVM page? I don't have much context, so I can't help you much.

    Maybe I can just say, that if you'd use Selenium for getting the page, it would run the JS and fill in the dynamic data... and it will be quite unreliable, will break randomly and it will be very slow...
    Jojo Aquino
    @jfaquinojr
    hello
    I installed dotvvm onto my legacy webforms. but ran into exception:
    System.IO.FileLoadException: Could not load file or assembly 'Microsoft.ReportViewer.DataVisualization, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    anybody know whats happening? I just downloaded the source code, but I figured asking here would be much faster
    Tomáš Herceg
    @tomasherceg
    @jfaquinojr Is the assembly version correct? Is it present in the bin directory of the application?
    Lubos
    @tatran_twitter
    Hiya, is there a ritch text editor control that supports HTML code vs Designer mode view? Example of one https://www.codeproject.com/Articles/157836/Efficient-Usage-Of-FckEditor
    Tomáš Herceg
    @tomasherceg
    CkEditorMinimal from https://github.com/riganti/dotvvm-contrib should support that.
    Lubos
    @tatran_twitter
    @tomasherceg Thanks. ;-)
    Lubos
    @tatran_twitter
    image.png
    @tomasherceg Works beautifully.
    Jojo Aquino
    @jfaquinojr
    @tomasherceg the version is not correct. These dependencies come from several other dependencies which is
    Depressing
    Is there a way to tell dotvvm to only scan specific dlls?
    Lubos
    @tatran_twitter
    Hiya, {{value: DateTime.Now}} => works, {{value: DateTime.Now.Year}} => don't work, Any tips?
    Tomáš Herceg
    @tomasherceg
    @jfaquinojr Is there an assembly binding for the library in web.config? When you build the project, there should be a warning about library version mismatch. When you double-click it, it should auto-generate the bindings in your web.config. https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions
    @tatran_twitter What's the behavior? Are there some errors in Dev Console?
    @tatran_twitter Can you try {{resource: DateTime.Now.Year}}? Resource bindings are evaluated on the server while the value bindings are translated to JavaScript, and DotVVM cannot translate DateTime.Year.
    Lubos
    @tatran_twitter
    @tomasherceg Thanks, does the trick...
    Jojo Aquino
    @jfaquinojr
    @tomasherceg thanks for the link I was able to move on. but now I am facing another issue.
    throw new NotSupportedException($"Can not translate field '{propAnnotation.MemberInfo}' to Javascript");
    Jojo Aquino
    @jfaquinojr
    copied the same code from WebFormsDotVVMCombo but added master pages into my legacy app
    the VMPropertyInfoAnnotation doesnt make sense to me yet
    Jojo Aquino
    @jfaquinojr
    Oh I forgot to mention this happens only to grid and repeater ctls
    Tomáš Herceg
    @tomasherceg
    It looks like you are using System.Reflection.PropertyInfo there, or some other .NET class which isn't serializable to JSON. Everything you put in the viewmodel should be JSON serializable.
    Jojo Aquino
    @jfaquinojr
    Hmm. That's weird. I will look into that, thanks. Though I'm pretty sure what I copied from the samples didn't use reflection. Other than what you said, is there anywhere else i could look at?
    Tomáš Herceg
    @tomasherceg
    @jfaquinojr Can you post a screenshot of the error page?
    Jojo Aquino
    @jfaquinojr
    image.png
    @tomasherceg sure
    Jojo Aquino
    @jfaquinojr

    oops my bad. I moved so much stuff around I accidentally changed the property to a field:
    public GridViewDataSet<Customer> Customers{ get; set;}
    to
    public GridViewDataSet<Customer> Customers;

    I changed it back and now its working.
    thanks @tomasherceg for your help.

    btw, very cool project you have, thanks for sharing it to the world.

    After I convert this legacy app to dotvvm I plan to do a dotvvm talk on our local .NET community here in Manila

    help spread the good news that is dotvvm to our webforms brethren
    Tomáš Herceg
    @tomasherceg
    @jfaquinojr Oh, maybe we should make the error message more clear. However, thank you for your feedback, I am glad that you like DotVVM. If you need some swag for the event, let me know - we have some stickers, T-shirts and so on. :-)
    Jojo Aquino
    @jfaquinojr
    @tomasherceg I'm sure the local community here would love some swag!
    ezev123
    @ezev123
    Hello
    LennartFuehrer
    @LennartFuehrer
    Hello
    Is there some way of increasing the depth of serialization? I've got a list of items where each item has another list. 2nd list however always ends up empty
    Tomáš Herceg
    @tomasherceg
    @LennartFuehrer DotVVM doesn't limit serialization depth, having list of lists should be possible. Is the inner list a public property with get & set? The serialization ignores fields.
    LennartFuehrer
    @LennartFuehrer
    Shit, after looking it over like 3 times... they were fields, yup. I feel a little dumb now. Thanks
    mmitchell-w
    @mmitchell-w
    Hello. I'm having trouble showing an arbitrary number of custom markup controls based on the results of a database query.
    Default.dothtml has a code-only custom control (Page) that takes ViewModels[] as a DotvvmProperty. DefaultViewModel builds this array from the database query. Page's OnInit adds new instances of markup control classes to its Children property.
    Markup controls do not appear (no HTML rendered, no console errors), but code-only controls do appear. The ViewModel[] is correctly rendered to my __dot_viewmodel_root.
    Alternatively, how could I replace Page with a Repeater and Placeholder, and substitute that Placeholder with my markup control at runtime? In WebForms we could get a reference to the Placeholder in the codebehind, and "Controls.Add" from there.
    Tomáš Herceg
    @tomasherceg
    @mmitchell-w This can be done, but the process is not so straight-forward.
    Basically, you can add the ID="something" to any control in the page and then use Context.View.FindControlByUniqueId to look for the particular control. Then you can call control.Children.Add(your control).
    However, you'll need to set the correct DataContext to the control - you can look at how we dynamically generate data-binding expressions in DotVVM Dynamic Data (https://github.com/riganti/dotvvm-dynamic-data/blob/master/src/DotVVM.Framework.Controls.DynamicData/DynamicDataContext.cs) - there are methods which can construct binding expression from a string. You can then call yourControl.SetBinding(DataContextProperty, bindingExpression).
    All of this should be done in the Init or Load phase, before the commands from buttons and other controls are fired - the control tree must be complete after the Load phase ends.
    Let us know if you run into any issues - all these things are possible, but they are documented only briefly.
    mmitchell-w
    @mmitchell-w
    @tomasherceg Is this advice concerning the former method (code-only control to host markup controls) or the latter (Repeater/Placeholder on .dothtml)?
    Tomáš Herceg
    @tomasherceg
    @mmitchell-w It will suit better the first method, but the principle would be the same for the latter one - you'd need to find the Repeater by ID and then look inside and build the controls for the individual items. But it looks easier to skip the Repeater and generate the controls yourself.