background preloader

.NET

Facebook Twitter

Getting MySQL work with Entity Framework 4.0 - Gunnar Peipman's ASP.NET blog. Does MySQL work with Entity Framework 4.0?

Getting MySQL work with Entity Framework 4.0 - Gunnar Peipman's ASP.NET blog

The answer is: yes, it works! Claim-based-security for ASP.NET Web APIs using DotNetOpenAuth « Zulfiqar's weblog. Source Code Recently I worked with a customer assisting them in implementing their Web APIs using the new ASP.NET Web API framework.

Claim-based-security for ASP.NET Web APIs using DotNetOpenAuth « Zulfiqar's weblog

Their API would be public so obviously security came up as the key concern to address. Claims-Based-Security is widely used in SOAP/WS-* world and we have rich APIs available in .NET Framework in the form of WCF, WIF & ADFS 2.0. Even though we now have this cool library to develop Web APIs, the claims-based-security story for REST/HTTP is still catching up. OAuth 2.0 is almost ready, OpenID Connect is catching up quickly however it would still take sometime before we have WIF equivalent libraries for implementing claims-based-security in REST/HTTP world.

Getting Started With ASP.NET Web API - Tutorials, Videos, Samples. ASP.NET team shipped the beta version of ASP.NET Web API which has been known as WCF Web API for more than a year.

Getting Started With ASP.NET Web API - Tutorials, Videos, Samples

It has seen 6 preview versions and we have now nearly the final bits and pieces. The beta version of the product has been merged with ASP.NET MVC so that we won’t feel ourselves in a fork in the road in order to create REST APIs. In my opinion, ASP.NET Web API is really exciting because it offers a simple and pluggable way to expose your data to the World. The one of the best parts is that you don’t have to just expose it as XML or JSON. You have the XML and JSON support out of the box but the format of the data is really up to you. Orchard Project - Home. Making your ASP.NET Web API’s secure.

Note: Code for this example is on Google Docs.

Making your ASP.NET Web API’s secure

SecureWebAPISecureWebAPITest Recently, I’ve been exploring the new ASP.NET Web API. So far, I’ve been impressed with how easy it is to build RESTful web interfaces. In the examples I’ve published, none have been secure. In the real world – the world that exists beyond the world of samples and demos – security is a matter than cannot be brushed aside. In research this topic, looking what others have done this far, I came away with a lot of approaches that in my opinion, where too complicated and quite frankly, a pain to setup.

For many applications, OpenID or oAuth can work fine. Of all the things that can be done to make your API, more secure, requiring it to run over HTTPS is the easiest thing to implement. Here is the custom action filter Nothing very complicated going on here. Tokens based on Public/Private Keys Of all the ways to authorize and authenticate, it seems to me that tokens have done a good at this task. IP Filtering Enjoy!! Secure WCF RESTful service using OAUTH. To get started with this article, we will build a WCF RESTful service which is called the service provider and client application (in this case it's a web app) which would use services and is called the consumer.

Secure WCF RESTful service using OAUTH

I wanted to build a security layer on top of my WCF RESTful service. So when I Googled I got many links targeting at OAUTH and all the articles and posts talking about using OAUTH with complicated examples. I could not figure out where to start. After many clicks on Google, I found pieces of code to understand what needed to be done to provide security for my RESTful services. Creating the Membership Schema in SQL Server (C#) This tutorial starts by examining techniques for adding the necessary schema to the database in order to use the SqlMembershipProvider.

Creating the Membership Schema in SQL Server (C#)

Following that, we will examine the key tables in the schema and discuss their purpose and importance. A Client-side Ajax Login for ASP.NET - Andrew Frederick. A question was posed on the ASP.NET forums recently asking how to have a login control that doesn’t refresh the page.

A Client-side Ajax Login for ASP.NET - Andrew Frederick

The ideal solution would be to just drop an ASP.NET Login control inside an updatepanel. However, the Login control (along with PasswordRecovery, ChangePassword, and CreateUserWizard controls whose contents have not been converted to editable templates) is not supported inside an UpdatePanel. ASP.NET MVC ViewResult vs PartialViewResult. Updating Partial Views with Unobtrusive AJAX in MVC 3. This blog has been relocated to See this post at it's new home: This is post is meant to be a more straightforward overview of my previous post.

Updating Partial Views with Unobtrusive AJAX in MVC 3

The previous post got a little long and turned into a walthrough. If you need a walkthrough of this, check out that post at So in my new exploration of web development, I found what I assume to be a fairly common need to have part of a view/page update without the entire page updating. In my particular case, I wanted to have a page that listed items but also provided a form that allowed you to add an item. This was eventually accomplised through the unobtrusive AJAX provided through the MVC and jQuery frameworks. The ProductListControl.cshtml is a very simple partial view that displays all the product names and prices in a table:

Partial Views with Different Models - MVC Razor. CodeProject In this post we will see: 1.

Partial Views with Different Models - MVC Razor

How to use Different Partial views on a Master View. 2. How to attach models to different Partial Views. Objective: I wanna create an MVC Razor application which will display both Personnel and Professional Details. Step 1: Create Models for both Personnel and Professional details. namespace PartialVsAction.Models { public class ModelA { public int EmployeeId { get; set; } public string EmployeeName { get; set; } public string Comapny { get; set; } public int FisacalYear { get; set; } } } namespace PartialVsAction.Models { public class ModelB { public int EmployeeId { get; set; } public string EmployeeName { get; set; } public string Address { get; set; } public string MobileNo { get; set; } public string Age { get; set; } public int FiscalYear { get; set; } } } Step 2: Create a regular class file which will act like a DAL, which will supply some data.

Professional Partial View (ProffesionalPartial.cshtml): ModelB (Personal) : Is it helpful for you? Partial views in ASP.NET MVC 3 w/the Razor view engine-Rachel Appel on Software Development. What is a partial view and when should I use it?

Partial views in ASP.NET MVC 3 w/the Razor view engine-Rachel Appel on Software Development

Primary Objects - Creating a Slick Login Form in MVC3 C# ASP .NET with Attribute Security, CSS3. The above web.config block would only allow users with the role of "admin" to access the folder "/secure" in the C# ASP .NET web application. MVC3 Security is a Little Different While classic ASP .NET security uses the web.config folder-based approach for protecting a C# ASP .NET web application, MVC3 is quite different. Since an MVC web application relies on routing via virtual folder paths, the web application could not be configured via the web.config, since the folder paths do not actually exist.

In fact, even using security based upon the routing itself, is discouraged, due to the complexity of verifying security for all possible combinations of routes within the MVC web application. This can be complicated even further when you consider all possible input combinations to the controllers that could result in different controllers being called. [Authorize] public ActionResult Index() { return View(); } We Can Do It Better [AllowAnonymous] public ActionResult Index() { return View(); } <! Player. Nested Collection Models in ASP.NET MVC 3 - Caffeine-Powered Life. Scenario: We want to create form where I can save information about a person. That person has zero or more phone numbers and zero or more email addresses.

The customer would like to edit everything about a person all at once, on a single form. This is a dynamic nested model problem. Suppose our person object looks like this: Using Ajax.BeginForm with ASP.NET MVC 3 Razor.