Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap to develop ASP.NET MVC applications

I'm new using this technology (and using ASP.NET MVC) so I want to create an app using the logic of .NET with Phonegap.

I searched information about if it's possible to create a PhoneGap application with ASP.NET MVC, and I found only negative answers.

Why the developers not recommend to use PhoneGap with .NET techology? I know that PhoneGap is only HTML-CSS-JS and not uses a server to run databases (probably I'm not correct with this).

I thought: I can move the logic of PhoneGap to my solution of Visual Studio, but I noticed that is the same thing if I create a new MVC application and then modify the HTML-CSS-JS files on Visual Studio as if I were developing in the workspace of PhoneGap.

Then, what's the difference? It's recommended use PhoneGap to develop ASP.NET MVC applications?

Sorry for my bad english, and I'll appreciate your answers.

like image 966
ArCiGo Avatar asked Feb 10 '26 03:02

ArCiGo


1 Answers

It is a popular misconception from those new to PhoneGap. PhoneGap runs html/css/js pages on the local device within a webview control. It does not run a web server, so no server-side technologies can be used for the pages themselves: no ASP.Net (incl MVC), no NodeJS, no ColdFusion, no JSP, no Ruby, no PHP, etc. All these require a service on a web server to run/interpret code on the server to generate html pages.

A good way to look at it is as if you ran the html file from your local file system in a browser, i.e. open file C:\myWebPage.html in your browser. If it is plain html, css, and js, it will run and display properly. If it had server-side technologies/code, it would not.

That is not to say you cannot use ASP.Net with a PhoneGap solution. Indeed, many developers do create web services, WCF services, and Web-API functionality in .Net, and use AJAX from javascript on the PhoneGap html page to get query results, partial pages, lists, data, etc from the server. Most of my PhoneGap projects use ASP.Net Web-API for server side functionality. And now with the Visual Studio Tools for Apache Cordova, you can have the PhoneGap multi-device project in a solution with your web service project.

Also, you can use MVC on the PhoneGap html pages, using javascript frameworks like AngularJS, Ember, etc. There are dozens to look at and choose from, if that is your preference. You just can't use ASP.Net on the mobile device.

like image 192
mharr Avatar answered Feb 15 '26 14:02

mharr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!