background preloader

Quick Sticky Notes Of Interest

Facebook Twitter

Hack Things Better. Custom Action Method Selector in MVC. Download source code - 2.34 MB Introduction The default routing algorithm for how the ASP.NET MVC framework invokes actions is like {controller}/ {action}/ {id} patterns.

Custom Action Method Selector in MVC

But this becomes more complex when you have two methods with the same name, or when you invoke an action when form data is submitted, or execute a method only when an AJAX request is made. Implementation This can be done using ActionMethodSelector attributes. AcceptVerbs ActionName. Submit a form using Ajax instead of Normal Post. For ASP.NET MVC, HERE!

Submit a form using Ajax instead of Normal Post

Is a much cooler approach: Basically, we use Ajax.ActionLink like this: The controller takes care of both the possibilities (Normal Post as well as Ajax post request): public ActionResult Index(int? Id) { var selectedGroup = _service.GetGroup(id); if (selectedGroup == null) return RedirectToAction("Index", "Group"); if (! Request.IsAjaxRequest()) { var model = new IndexModel { Groups = _service.ListGroups(), SelectedGroup = selectedGroup }; return View("Index", model); } return PartialView("ContactList", selectedGroup); } Of course, we need the three script references: okdone.

Pattern for Creating Generic WCF Services. Download source code - 194 KB Introduction I work on a solution that makes a lot of use of Generics.

Pattern for Creating Generic WCF Services

We have just started to add in a Silverlight control to the solution and we are using WCF to communicate with the existing code base. I have looked around to find a solution where by we could have generic services that make use of the existing generic model. I didn't really find what I was looking for so I have come up with a test project that presents a pattern for generic services and I would like to put it out there to see what others think of it. Using the Code This project contains a base service class with a corresponding contract class that are both generic.

This base service class also has a dependency that will be resolved based on the type of T. Here is the interface INumber with a couple of basic implementations: The next stage is to declare some .svc files, one for each type we want the service to be used with; in this instance, one for NumberOne and one for NumberTwo. Website Testing Techniques. Introduction First, let’s have a web testing checklist: Functionality Testing Usability testing Interface testing Compatibility testing Performance testing Security testing 1.

Website Testing Techniques

Functionality Testing Test for – all the links in web pages, database connection, forms used in the web pages for submitting or getting information from user, cookie testing. Check all the Links Test the outgoing links from all the pages from specific domain under test Test all internal links Test links jumping on the same pages Test links used to send the email to admin or other users from web pages Test to check if there are any orphan pages Lastly in link checking, check for broken links in all above-mentioned links Test Forms in all Pages Forms are the integral part of any web site. First check all the validations on each field Check for the default values of fields Wrong inputs to the fields in the forms Options to create forms if any, form delete, view or modify the forms.

Claim based Authentication and WIF : Part 2. Introduction This post is the second part of my post on Claim based Authentication.

Claim based Authentication and WIF : Part 2

You all can access my first post from here. Claim based Authentication and WIF [^] In my last post, I discussed the problems of current day’s authentication Implementation, details about Claim based authentication and basic components of Claim based authentication. Now in this post, I’ll discuss about Windows Identity Foundation and the main concepts one by one with a sample. What is Windows Identity Foundation(WIF) First of all, I'll say Windows Identity Foundation is a Microsoft way to leverage the Claim based Authentication. Windows Identity Foundation enables .NET developers to externalize identity logic from their application, improving developer productivity, enhancing application security, and enabling interoperability.

Claim based Authentication- WIF : Part 3. Introduction This is the third part of the series on Claim based Authentication and WIF.

Claim based Authentication- WIF : Part 3

In the first part, we discussed the basics of Claim based Authentication and in the second part, we explored the WIF and also discussed an example and made a Custom Identity Provider (IP) and ASP.NET application(RP). This ASP.NET application uses the Identity provider for authentication. You can find these two articles below: Now in this post, we will discuss the problems of the model that we discussed in our earlier articles. In our last example, we discussed the simple approach to use Custom Identity Provider for Authentication. Let's say, I made an application and I want to allow users to give options to choose the Identity Providers. But as in the open world, Identity Providers use different protocols and some have developed their own proprietary protocol, so your RP must understand all these protocols.

Claim based Authentication and WIF. Introduction There is a lot of buzz about Claim based Authentication.

Claim based Authentication and WIF

In this article, we'll understand what is Claim based Authentication, what are the benefits and a lot more. This is my first article in this series. In subsequent posts, we will see the implementation and more scenarios. C# - JavaScript code to refresh page and or telerik grid.