How to create server on ASP.NET Web API? - c#

I would like to create a web server application using ASP.Net WebApi 2. The application must parse a HTML page and upload clear data to Azure blob storage.
I've never created Web applications and I don't know how is right worked. Please show me how it is worked and what tehnology to use.
I would like to use ASP.Net WebApi 2, so that I can create an API that parses and uploads data to Azure blob storage.

Please check out many tutorials there are on the internet.
http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-get-started/
http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs/

Related

Blazor WebAsembly Access Database

I am just thinking that, Since Blazor Webassembly can running in browser independently(off-line), how can it access database without a WebAPI?
Can Blazor Webassembly use sqlite in browser directly?
You can use in browser DBs IndexedDB, Web SQL or local storage throught JSInteropt
How can it access database without a WebAPI?
It can't access any database without a Web Api. You can only access the JavaScript localStorage and sessionStorage Apis, using JSInterop. Right now Blazor does not support such adventures, but I'm not much acquainted with products created by third parties and the community... perhaps they've created something that can be useful for you.
No Blazor Webassembly can not use sqlite in browser directly.
Blazor Webassembly can running in browser independently(off-line),
it can access database without a WebAPI but first you have to start creating project by chossing
Blazor Web assembly project then use ASP.Net Core Hosted and Prograssive Web App selected.
Now you can use database and share logic. And for Off line capability you have to change in worker.js according to your need.
And You can use in browser DBs IndexedDB, Web SQL or local storage or JSON File

Access FTP Hosted Web API in C#

I have created a Web API in ASP.NET. I deployed this API in Azure Web App and I was able to use controllers from web API like this http://.azurewebsites.net/api/{controller}.
Now I have deployed the Web API on an FTP server and I am unable to access my controllers like I did before. Any idea on how to do it?
I would really appreciate your help as I am new to FTP.
Thanks in advance.
Just because you can upload/deploy an asp.net site via FTP, it does not mean that the server can automatically run the site and start serving those endpoints (/api/{controller}) automatically.
You need to clarify with whoever is hosting your FTP server if such server can also host asp.net websites. If so, you need to ask them in what particular folder within that server you need to upload your site to.

Upload a video using asp.net MVC WebService

I want to upload a video file using asp.net mvc . I am sending the file as postbody. How can this be retrieved later from the server using webservice. I have seen this example . Also this question helped me to understand it more. But I m not sure how to fetch post body.
But no sure how this works. How to do his properly in .net c#
In order for the file to be available later, you need to save it somewhere during the upload - either to a database or a folder on the server. Then, your web service needs to know how to retrieve it from that location.

ASP.NET website to be deployed on Windows Azure with databases

I know this is a very common question and I could find several answers, but I think my situation is a bit different.
So, I have an ASP.NET Website (NOT a web application), built using "Web forms". Its a very simple website which does bunch of REST calls and talks to the SQL Server 2008. Can you please help me finding a step by step guide to deploy the same on Windows Azure using VS 2010? As of now, the website runs fine on a traditional web hosting server.
So far what I am getting are approaches which use MVC (and using ASP.NET web application, not website). I don't think that I should be concerned about MVC at all? Does a website vs. web application aspect make a difference? If yes, do I need to convert the website to web application?
There's a lot of content on web, so I am a bit confused given my condition. Can someone please put me in right direction? Thanks a lot.
You'll need to convert your Website project to an ASP.NET Web Role project, whether you first convert it to a ASP.NET Web Application or not doesn't really matter. The rest of the tutorial you already linked to applies just fine.
There's no need to look at ASP.NET MVC, It's a different technology than web forms, and there's no need to move to it in order to get your site hosted on Azure.
As for your database, unless you host that yourself in a VM-Role or somewhere else (and connect it using Azure Connect), you'll need to convert it to Sql Azure or Azure Table Storage. SQL Azure is largely compatible with SQL Server, but there are a few features which are unsupported.

How to upload text to an ASP.NET MVC 2 Action from a Windows Application

I'm new to asp.net mvc and web development in general and would like to know the best way to pass text from a windows application written in c# to a asp.net mvc website so it can be stored in a database. Is it possible to call a controller action (via a url similar to REST) from the Windows application or do I need to create a web service? If someone can point me to a verbose example that would be great.
Thanks
You can use the WebClient class. Look here for a simple sample.
Hope this helps.
Why do you want to pass it to your MVC site to store in the database? How are you interacting with your database in the MVC site?
If you have two different applications that need to access the data you should put it in a separate layer and may be create a WCF service or a Web Service.

Categories