Aspx page - Ajax.LastData

0 favourites
  • 4 posts
From the Asset Store
Template for making an interactive book or a simple story book
  • Hi,

    I was able with the method ajax.lastdata to recover a string from a asp.net page (aspx), the code is very simple but worked very well:

    Page_Load event of the mypage.aspx:

    sGet = "1200"

    Response.Write (sGet.Trim)

    and in Construct2:

    Ajax -> Request "http://www.mypage.com/mypage.aspx" (Tag: GetMyValue)

    MyString-> Ajax.LastData (Tag: GetMyValue)

    I can not understand why these commands do not work anymore, maybe it was a bit 'of time that I don't update the project, it is possible that the latest release has this problem/bug?

    Someone is able to retrieve a string from an aspx page? can you please write an example?

    Thank you for an answer,

    Ivan

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • We haven't changed the AJAX object for some time. Perhaps cross-domain issues are to blame. Look up AJAX in the manual for more information about that.

  • Hello Ashley,

    definitely is not a problem of cross-domain, it worked great,

    it seems that it does not recognize the command "response.write", the output sent from the web page to Construct2 is for example:

    *---------------------------

    ITA;cinghialetto;2000;1

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    *---------------------------

    The string "ITA;cinghialetto;2000;1" is not recognized from the method Ajax.Lastdata

    Have have please an .net example to send the output to C2?

    Thank you and best regards,

    Ivan.

  • Hi Ashley,

    I'm really sorry, I made a programming error in Construct2: I closed the group containing the ajax commands even before they have read the method LastData.

    Thanks and best regards,

    Ivan.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)