Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Send variable/data from mobile web app to asp.net .aspx

$
0
0

I have created a mobile web application using phonegap framework (HTML/Javascript/Jquery)

I will like to send some data from my mobile web application to my .aspx which is under MMORPGapi.sln (just a typical asp.net api project)

I am now trying to do a test whether does it work but it fails... Is there something wrong with my code? my ip address? Am I doing the correct way?

How do i actually post a data from my phone and how my authentication.aspx.vb actually be able to receive the data?

*Both computer and mobile are using same home wifi

This is the steps i do to check whether the post is succesfull

  1. open my asp.net project on visual studio
  2. Run the authentication.aspx on firefox through visual studio
  3. i click the submit button my mobile phone
  4. The testLabel.text at authentication.aspx still NO value. nothing happen. and my mobile also NEVER receive a response saying "Post Success" 

The below method will be triggered once i click the submit button on my mobile web app

function login()

         {

         var username = "test";

         var password = "test";

         var sid = "test"

        

                   $.ajax({  

    type: "POST",  

    url: "http://192.168.1.182:49652/Authentication.aspx",  

    data: "{username:'" + username + "', password:'" + password + "', sid:'" + sid + "'}",  

             

    cache: false,   

    dataType: "json",  

    success: function(msg) {

     

        alert(msg)

    }

});     

         }

The below code is what i placed in the page load event of my authentication.aspx.vb.

I placed an empty label on my authentication.aspx to test whether am I able to receive the data and display the data which will be shown on my computer web browser once i click the submit button on my mobile web app.  


ProtectedSub Page_Load(ByVal sender AsObject,ByVal e As System.EventArgs)HandlesMe.Load

       Dim asd AsString = HttpContext.Current.Request("username")

        testLabel.Text = asd

        Response.Write("Post Success!")

  EndSub


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>