Aspx page - Ajax.LastData

Discussion and feedback on Construct 2

Post » Mon Aug 26, 2013 8:31 pm

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
B
6
S
2
Posts: 18
Reputation: 1,111

Post » Tue Aug 27, 2013 11:00 am

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.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Tue Aug 27, 2013 2:19 pm

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.
B
6
S
2
Posts: 18
Reputation: 1,111

Post » Tue Aug 27, 2013 3:34 pm

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.
B
6
S
2
Posts: 18
Reputation: 1,111


Return to Construct 2 General

Who is online

Users browsing this forum: tarek2 and 7 guests