locked
Visual Studio 2012 - LightSwitch Web Application - WebClient Usage... RRS feed

  • Question

  • Hello,

    I am building a LightSwitch Web Application using VS 2012. On one of my screens, I have button. Whenever this button is pressed, I want to make an HTTP GET call using WebClient.

    When I click the button, there is an exception.

    However, when I run my the app as a Desktop app, then this works.

    Is there a way to tell a button click to delgate the call to the server and invoke a method on the IIS side?

    Thanks

    Saturday, March 9, 2013 11:50 PM

Answers

  • A WebClient request from the LightSwitch Web App indeed works, but I forgot the cross-domain HTTP request issue! I was making a call to a different domain and that is not possible via a browser due to security.

    Once I changed to call a WebApi on the same domain, it worked!


    • Edited by MoniMoni Monday, March 11, 2013 4:24 AM
    • Marked as answer by MoniMoni Monday, March 11, 2013 4:24 AM
    Monday, March 11, 2013 4:23 AM