transferring web page into web service - asp.net-web-api

Suppose we have a primary web page that most of our business logic in form of modules will appear inside this web page and it will trigger lots of other functionalities, something like dotnet nuke default.aspx. we are going to use this web form in a mobile application, my question is, is it possible to transfer my primary web page via web Api or in other word adding a web service endpoint at top of Web Page(layer) to transmit both web page UI and its logic?
Thanks.

Related

How to build custom pages in CRM Dynamics?

I am a beginner to CRM Dynamics. I want to build a web page in CRM Dynamics. Example like Registration page, Listing page of users i.e. any page which displays data based of custom business logic and pages should be authorized only to authorized users.
I just want to build site just like we do with Salesforce using visualforce pages and custom apex classes and all.
How to achieve same thing in CRM Dynamics? and what are ways to achieve this?
The Sitemap allows you to bind to a custom webresource.
You might want to start by adding to your Stitemap an item that links you to your custom HTML page and then work with json, jquery, for your business logic.
From the HTML you can call actions using Process.js and run C# logic.
Alternatively you can consider Portal.
I often use the WebApi endpoint, an html web ressource and a single-page application javascript framework, like Knockout, to achieve this.
The important is to host every component as a web ressource or use a CDN.

ASP.NET Core Web API vs ASP.NET Core Application

First off, I apologise if this is a trivial question but I am getting so confused by the information I am reading. I have put off posting on here as I feel my question is too broad but I can't find a definitive answer. I am a C++ developer by trade but I am wanting to get into web development.
My end goal is to have a web API that is consumed by both a web app and mobile app. I want to get the structure nailed first by developing an web API and web app and then expand it to a mobile platform later on.
My aim is to have 4 separate sections - Database -> WebAPI -> Web App
-> Mobile App
all of which are protected with username/password etc.
I have decided to use ASP.NET Core but when creating an application I am given two options in visual studio - ASP.NET Core Application or Web API. I have tried creating a Web API and a separate Core Application but can't work out how to call the web API. I have also tried creating a Core Application as it seems like I should be able to do everything I want in one project but I am worried that the Web API won't be separated enough to be able to call from a mobile app.
I will be working with a database containing sensitive information so obviously want to protect access to the Web API and Web/Mobile app. I have been watching courses on Pluralsight about Identity but I have read that it doesn't work well with Web API's.
Basically I am getting extremely confused when in my mind my end goal should be relatively simple to achieve. If anyone could give me any pointers as to what technologies I need to use would be fantastic.
ASP.NET Core WebAPI is specifically designed for building REST-ful services.
ASP.NET Core Application is used to create web applications that returns both views and data (it's an analog of Asp.NET MVC from standard Framework).
Which to choose is really depends on kind of WebApp you are going to use. If you plan to use some SPA framework, you don't need mechanisms to generate views on server side - WebAPI is a great choice, otherwise choose Application. Here you can find more details on differences.
As of security concern, there no issues with WebAPI. It provides a lot of mechanisms to secure your API and restrict access to methods based on user's identity. Please look at this article as an example.

Offline Application Development using Kendo UI

I am trying to develop the application using Kendo UI. This will be html application using Kendo UI and the data will be provided by Web API.
The main purpose is i want this application to be offline enabled. Means if there is no internet connection then also it should serve the cached page.
By doing some research i came across Kendo UI Offline Handling.
Here is my understanding by after refering the above link:
As per my thinking this approach will be used when the WEB API is off due to some reason but then also the html pages will serve the cached data contents. But to do this my html application should be working live ( using internet ).
Am i correct ?
If i am correct than what should i in order to make my application serve the user without internet connection ( offline mode ) using html and Kendo UI. ?
Thanks
To enable a web application to be useful offline you need to think about how to persist its data, such as application data, user data and session state, on the client. I suggest you do some research on the Web Storage API and go from there.

asp.net MVC Web API VS asp.net MVC 4 & MVC 3 internet application

i read about the beta version of asp.net MVC 4 web API , i think that it is related to building web services. So are these two frameworks (MVC 4 internet application & Web API) targeting different types of application or they may be used for building similar types of application but using different frameworks?
for example if i need to build an internet application for a registration system for a university or an internet shopping store (which i use to develop using asp.net MVC 3 internet application),, then will these two frameworks be suitable for these types of applications ???
Thanks for any help ...
BR
Those are just 2 templates. No matter which one you choose when creating the application initially you could always later change and add functionality. The MVC 4 internet application template is similar to the ASP.NET MVC 3 internet application template. It creates a default Home and Account controllers, it registers a default route and adds a couple of views.
The Web API template in addition to all this it adds an API route and an ApiController allowing you to expose RESTful APIs in your web application. The Web API is basically a simplified way to build RESTful services. Up until now this was possible with WCF but the Web API makes it really simple. The Web API could be self hosted. You don't need to put it in an ASP.NET MVC application.
The webapi makes it simple to create HTTP services. I have only used them to return json. You can use either for the types of applications you are building.
Take a look at this blog article from Scott Guthrie http://weblogs.asp.net/scottgu/archive/2012/02/23/asp-net-web-api-part-1.aspx
Web Api basically lets you create HTTP REST full services. The API also gives one full access to the http requests and responses in a type safe way.

Designing a web service to be used by the iPhone and a web client

I'm designing a web service that serves up JSON through a REST API. This API is currently being used by an iPhone app to do CRUD operations.
My question is, can I design a web client that uses this REST API using nothing more than ExtJS (or some other RIA framework) and HTML pages? In other words, can I create a static HTML page that uses ExtJS to send AJAX calls to the REST API and receive JSON data from it? Or is this thinking too naive and wrong?
I think this is perfectly acceptable as long as you know that your users browser will be able to handle javascript and AJAX accordingly.
Yes! YES! You can use static html and js files, served by any web server, to build an Ext JS application. Ext JS is very happy to talk REST and JSON to your web service.
Build your Ext JS application outside of ASP.NET MVC. You don't need it.

Resources