locked
Problem debugging button action HTML Client RRS feed

  • Question

  • Hi,

    I'm having a hard time debugging an execute function that was working fine until, out of the blue, stopped working on the server (IIS 7.5), but not when I run the application inside Visual Studio 2013 update 3.

    The code, wich is very simple, is as follows:

    myapp.InformesServicioFiltro.Download_execute = function (screen) {
    screen.getReports().then( function(report) {
    
            var url = location.href;
            var loc = url.indexOf('HTMLClient');
            if (loc > -1) {
                dwnURL = url.substr(0, loc) + "DownloadReport.aspx?id=" + report.selectedItem.Id;
            }
           
            window.open(dwnURL, "_blank");
        });
    };

    Nothing has changed on the server, the application was updated to msls-2.5.1 and VS2013 has update 3, but the deployed version of the App, prior to those changes, has the issue too. What strange is that it only happens on the server, and I don't know how to debug the error.

    I tried enabling Trace, but there's nothing to record since the button acts as it has no action, and when inspecting the code with IE11 dev tool I can't find where the JavaScript associated with the click event is.

    IE11 tools capture

    Also I tried with Google Chrome, with same result, since I am having problems with IE11 opening links after the latest security update, but that's another issue.

    What's the difference between the "built-in" IIS and the apps running in debug mode inside VS and the deployed ones? I mean, is IE opened in a different mode or something?

    Any suggestions?

    thanks.


    Nicolás Lope de Barrios
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to "Mark as Answer". This will help other people find answers to their problems more quickly.

    Friday, August 22, 2014 10:57 PM

Answers

  • It was the dumbest thing: I forgot JavaScript is case sensitive, so when the browser is launched by VS the URL contains "HTML Client", but if a user launches the App using a different case, causes loc = -1.

    Sorry everybody.


    Nicolás Lope de Barrios
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to "Mark as Answer". This will help other people find answers to their problems more quickly.


    Tuesday, August 26, 2014 1:43 PM

All replies

  • Hi,

    What's the difference between the "built-in" IIS and the apps running in debug mode inside VS and the deployed ones? I mean, is IE opened in a different mode or something?

    IIS Express is only for testing Web Sites locally, and IIS Server is the Full Web Server Product.

    From your description above, I think there is something wrong during you deploy your LS app to IIS.

    Turn on tracing to get the detailed error message and that will help you troubleshoot. Here's info how to debug that message:

    http://blogs.msdn.com/b/lightswitch/archive/2011/09/20/diagnosing-problems-in-a-deployed-lightswitch-application-eric-erhardt.aspx

    At the same time you can also check whether it has list of LS deploy issues.

    Or you could also consider resetting your IIS, and check whether it still has same issue.

    Please let me know if there is anything that I can do to help.

    Best regards

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 25, 2014 1:21 PM
  • Thank you Angie. I agree with you, it seems like an IIS issue. I've read and follow Eric's steps before and I think none of them apply in this case.

    However, I tried deleting the whole site and re-publishing the app, with the same result.

    Trace is useless since clicking on the button does NOT send any info, so there's nothing to debug. Like I said, is as if the button had no code associated. When you click on it nothing happens.

    I'm going to try sending some info to the console, this article looks helpful: http://msdn.microsoft.com/en-us/library/ie/dn255006(v=vs.85).aspx#traces


    Nicolás Lope de Barrios
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to "Mark as Answer". This will help other people find answers to their problems more quickly.

    Monday, August 25, 2014 1:54 PM
  • It was the dumbest thing: I forgot JavaScript is case sensitive, so when the browser is launched by VS the URL contains "HTML Client", but if a user launches the App using a different case, causes loc = -1.

    Sorry everybody.


    Nicolás Lope de Barrios
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to "Mark as Answer". This will help other people find answers to their problems more quickly.


    Tuesday, August 26, 2014 1:43 PM