Restrinct action to one single PC under MVC C# web application? - asp.net-mvc

It's possible to restrict one Action from my asp.net mvc website to a single PC while the entire website can be accessed by any PC?

Related

Is it possible to add ODataController controller to an MVC web app?

I have an existing asp.net MVC 5 web application. I do not want to crate a separate project for asp.net webapi OData and I want re-use www domain of the web app for OData app. I'd like to add some ODataControllers to that MVC web application to be consumed in some cshttml view pages with flexible, robust queries. Is it possible to do that? If so, how is about the routing configs must be updated for web app routes and OData routes? Thank you.

ColdFusion/ASP split URL handling

I am working on a new ASP.NET MVC (IIS 7) application that needs to hang off the URL of an existing group of ColdFusion applications. The URL hosts a series of applications and is of the form:
http://myapps.com/allApps/<appNumber>/<appViews>
ColdFusion is currently handling all the applications on this URL. I need the new ASP.NET application to use the same URL format but have a specific <appNumber>. So for example, ColdFusion handles:
http://myapps.com/allApps/1/<appViews>
http://myapps.com/allApps/2/<appViews>
http://myapps.com/allApps/3/<appViews>
http://myapps.com/allApps/4/<appViews>
New ASP.NET app needs to handle:
http://myapps.com/allApps/5/<appViews>
I know how to use ASP routing to send the requests to my ASP app controller once my app is getting the requests, but I don't know how to tell IIS to send the specific URLs to my application so they are not processed by ColdFusion.
Unless you have IIS set up to pass ASP.NET pages to ColdFusion for processing, it should not matter.

ASP.NET MVC intranet application based on a workgroup

Is ASP.NET MVC intranet application intented only to be used as a Windows-domain based application or there's a possiblity to run it inside a workgroup?
Thanks!
The word Intranet has no correlation with any network operating system (Windows Domain, Workgroup, etc). How you build your web based application (using any language) is indifferent to who can access it. So to answer your direct question, you can use ASP.Net MVC to build a website that can be accessed by anyone on a local network if you configure the website and/or hosting environment (IIS) in that manner.
MVC (Model View Controler) is a way to develop application (web + desktop) and can be used as Windows-domain App or inside a workgorup or without of both

Sharing authentication across asp.net mvc 3 website and silverlight 4 business application via RIA Services

I have an asp.net MVC 3 website and a silverlight 4 business application. Separately, they both use the asp membership system (the silverlight app through RIA Services). I can run them both separately and create users or login from either the website or Silverlight business app. In this respect, they also share the same database, so registering a user from either one will go to the same tables in the same database.
What I would like to do is host the Silverlight business app in the MVC 3 website and share authentication across the two. This means that the website will have a link to launch the silverlight app, so if I login through the website and launch the silverlight app, I would like the silverlight app to know I am logged in already.
Alternatively, I would like to be able to launch the silverlight app as a standalone desktop application and login through RIA Services there. This part I can do already, but I need to maintain that.
Does anyone have any good ideas of how to host a Silverlight business app in an MVC 3 website and share authentication? Is there a way to convert the default web application that generates when you create a business app into an MVC 3 web application, and might that do the trick? Even if the website can't be MVC, can the authentication sharing be done?
Sorry for the complex description, any help is appreciated. I really am at a loss to find any tutorials or examples of this, which I figured would be a common desire.
If your Silverlight application was initially developed to handle login then you shouldn't have a problem doing this. You can authenticate from an ASP.NET MVC3 app (FormsAuthentication.SetAuthCookie) and have a view that hosts your Silverlight application. When the SL application starts up part of its process is to check if WebContext.Current.User.IsAuthenticated so it will take over from there, if the user is already authenticated your SL app should bypass it's login.
In the ASP.NET MVC3 application you can stick an [Authorize] on the controller for the view hosting the SL plugin. It won't display this view unless the user is authenticated.

How to use Silverlight XAML views as if they were MVC Views

I recently got into Silverlight development. So far I've managed to create a single Silverlight XAML view which pulls in data from an SQL Server Database using the ADO.Net Entity Framework and displays the data in a Silverlight DataGrid. I can also perform simple editing and update functionality on the data and persist it back to the database. At this point my understanding fails. From what I gather, the Silverlight Client Application is hosted inside an ASP.NET or ASP.Net MVC web application. Normally I would just build a website using ASP.Net MVC and use a few jQuery controls, etc., to spice up the interface on each view. How do I go about using these different Silverlight XAML views that I create in my ASP.Net MVC application like they were MVC Views? Have I totally missed something here?
RIA Models
There are two different models for integrating Silverlight (or any RIA technology) into your website:
Entire Silverlight application hosted in simple website
Silverlight controls integrated into a website with other interaction (forms, jQuery, etc.)
Either model works well, it's up to you to decide which works better in your scenario.
Silverlight communication with the server
Your Silverlight application is a plugin hosted in a browser, so it's best to think of it like jQuery or other client-side code. There are several ways to communicate back to the server:
RIA Services
ADO.NET Data Services
Custom WCF service
Other REST / SOAP communications you build yourself
Silverlight supports WebClient and HttpWebRequest, so you can get as low-level as you'd like in your client-server communication. I really recommend looking at RIA Services since it handles not only the communications, but also the validation rules.
Silverlight integration with HTML / Javascript
Silverlight can both call and be called from Javascript via the HTML bridge. This means that your Silverlight components can be as closely integrated with your web-page as you'd like. Silverlight can also directly interact with the DOM - setting and reading form values, changing CSS properties, etc. You can do just about anything you'd do in Javascript via the HTML bridge if you'd like.
In order to update your data model from your Silverlight application (which is running on your client's machine) is to utilize WCF (Windows Communication Foundation). Your Silverlight application will communicate to your server using WCF, and none of that has really anything to do with how you're serving up your Silverlight app (whether you're using Webforms or MVC).

Resources