background preloader

ASP.Net & MVC

Facebook Twitter

Untitled. Self-Hosting SignalR in a Windows Service - Rick Strahl's Web Log. A couple of months ago I wrote about a self-hosted SignalR application that I've been working on as part of a larger project.

Self-Hosting SignalR in a Windows Service - Rick Strahl's Web Log

This particular application runs as a service and hosts a SignalR Hub that interacts with a message queue and pushes messages into an application dashboard for live information of the queue's status. Basically the queue service application asynchronously notifies the SignalR hub when messages are processed and the hub pushes these messages out for display into a Web interface to any connected SignalR clients. It's a wonderfully interactive tool that replaces an old WinForms based front end interface with a Web interface that is now accessible from anwhere, but it's a little different SignalR implementation in that the main broadcast agent aren't browser clients, but rather the Windows Service backend.

Kendo Grid Javascript data manipulation. The data the grid is bound to is available for use in javascript if required.

Kendo Grid Javascript data manipulation

It can be obtained through its datasource. To get the data for a given Id then you can use var grid = $('#kgridA').data('kendoGrid'); var dataItem = grid.dataSource.get(id); The dataitem represents all the data in the model the grid is bound to plus some more. A key field is the uid as this is a guid that is used in each tag on each grid row. For example if you had your model Id then you could find the datasource data and get the uid which then can be used to manipulate the html display for highlighting etc. The dataItem can have its value set by specifying the property or using the set dataItem.name = "xxx"; or dataItem.set("name","xxx"); or dataItem[name] = "xxx"; The first option is only available if you know the fields your working at design time. once modified then the grid would need to be refreshed to show the dirty flags $('#kgridA').data('kendoGrid').refresh();

Understanding Certificate Name Mismatches. Recently, I received a query from the Windows Mobile team– they had observed that visiting triggers a certificate name mismatch error on IEMobile, but doesn’t seem to trigger any error on Windows 7 when using the desktop versions of Internet Explorer or Firefox.

Understanding Certificate Name Mismatches

Now, long-time readers know that I love a good mystery, so I was excited to take a look at what was going on here. I first verified the original problem: IE on Windows Mobile 6.5 does indeed show the name mismatch warning, and desktop IE doesn’t show any warning at all. My next step was to watch the Desktop’s traffic with Fiddler, which, when configured to perform HTTPS decryption, will warn about any certificate errors by default. I was intrigued to find that Fiddler does, in fact, warn about the certificate when visiting As you can see, the certificate presented is for “mail.google.com” instead of “gmail.com”: Centralized Logging and Diagnostics with Elmah and NLog - Ben Foster.

Update We now use Elmah.IO for centralised logging.

Centralized Logging and Diagnostics with Elmah and NLog - Ben Foster

Iis - ASP.NET Web API OperationCanceledException when browser cancels the request. CRUD with SPA, ASP.NET Web API and Angular.js. Download AngularJsCRUD.zip - 854 KB Introduction.

CRUD with SPA, ASP.NET Web API and Angular.js

Web API CRUD Operations with Knockout. Posted By : Shailendra Chauhan, 01 Apr 2013 Updated On : 01 Apr 2013 Keywords : CRUD operations using knockout and web api,insert update delete using knockout and webapi,web api insert update delete In previous article, I have explained Knockout CRUD Operations using MVC4.

Web API CRUD Operations with Knockout

In this article, I will demonstrate, how to use Knockout with Web API for CRUD (Create, Read, Update, Delete) Operations. Step 1: Define Model. Using JSON.NET for dynamic JSON parsing. With the release of ASP.NET Web API as part of .NET 4.5 and MVC 4.0, JSON.NET has effectively pushed out the .NET native serializers to become the default serializer for Web API.

Using JSON.NET for dynamic JSON parsing

JSON.NET is vastly more flexible than the built in DataContractJsonSerializer or the older JavaScript serializer. The DataContractSerializer in particular has been very problematic in the past because it can't deal with untyped objects for serialization - like values of type object, or anonymous types which are quite common these days. The JavaScript Serializer that came before it actually does support non-typed objects for serialization but it can't do anything with untyped data coming in from JavaScript and it's overall model of extensibility was pretty limited (JavaScript Serializer is what MVC uses for JSON responses).

Self-hosting ASP.NET MVC. Recently I was considering the technology to use for the GUI of a windows desktop client application I’m working on in my spare time.

Self-hosting ASP.NET MVC

The standard picks are obviously WinForms or the more modern WPF. However, I have some problems with them in this case: the technologies above are (windows) platform dependent, while for instance HTML5 isn’t.the application I’m working on is a debugger. Perhaps details about that will follow in a future post, but I would like to be able to run it remotely from an arbitrary machine (and OS).I really appreciate the power of modern javascript libraries such as knockout.js, and I can’t use those with WPF or WinForms. Now, for Windows 8, the store applications can be developed in HTML5 already, while desktop apps can’t. Serial Port ActiveX Control - Download. Serial Port component for Windows programmers. Add serial communication capabilities to any Windows or .NET application Adding serial communications requires specialized knowledge that might be outside an individual programmer's expertise.

Serial Port component for Windows programmers

For years, developers have relied upon the power and reliability of the ActiveXperts Serial Port Component serial communications control. Easy to use APIControl devices over a serial port32-bit ActiveX and 64-bit ActiveX includedSamples available in C#, VB, ASP.NET, HTML, PHP, Javascript, Delphi and more Use ActiveXperts Serial Port Component for different purposes: To control manufacturing machines via the serial port; To configure network devices (like print-servers, routers) via the serial port; To control a modem, connected to the serial/USB port or Bluetooth; To transfer files through a null modem cable; Any other scenario where serial communications is involved.

ActiveXperts Serial Port Component features the following: Using ActiveX Controls to Automate Your Web Pages. This article describes how a developer can add Microsoft ActiveX support to an existing OLE Automation control.

Using ActiveX Controls to Automate Your Web Pages

Introduction An ActiveX control is an object that supports a customizable, programmatic interface. Using the methods, events, and properties exposed by a control, Web authors can automate their HTML pages. Examples of ActiveX Controls include text boxes, command buttons, audio players, video players, stock tickers, and so on. Sean McAlinden's Blog - Asynchronous processing in ASP.Net MVC with Ajax progress bar. I was asked the other day how to process a long running task asynchronously using ASP.Net MVC along with JQuery to update a progress bar on the view via Ajax. There are many ways of accomplishing this type of multithreading, in this blog I’m going to document one of the simplest and easiest to implement (this solution is really for small apps). Firstly, create a class that will manage the long running task – as this is a contrived example without the use of a database, the class is going to have static dictionary property that will store the unique key and status of each long running task. – the dictionary is used to allow for multiple users firing off individual long running tasks.

Now we have the long running class in place we need to create some controller actions to do the following: Start the long running process End the long running process Get the current process status One interesting line you may have notices in the GetCurrentProgress method is the following: Cutting Edge - Build a Progress Bar with SignalR. In the past two installments of this column I discussed how to build an ASP.NET solution for the evergreen problem of monitoring the progress of a remote task from the client side of a Web application.

Despite the success and adoption of AJAX, a comprehensive and widely accepted solution for displaying a context-sensitive progress bar within a Web application without resorting to Silverlight or Flash is still lacking. To be honest, there aren't many ways in which one can accomplish this. You might craft your own solution if you want, but the underlying pattern won’t be that different from what I presented—specifically targeting ASP.NET MVC—in the past columns. Exception Handling in ASP.NET MVC. Index Introduction Exception handling is a serious matter in any application, whether it's web or desktop. Implementing a proper exception handling is important in any application. In most cases once we catch the exception we have to log the exception details to database or text file and show a friendly message to the user.

Don’t Do Role-Based Authorization Checks; Do Activity-Based Checks. I’ve built a few dozen security mechanisms in my career. Unfortunately, I kept getting it wrong, hence the need to keep building them. Over the years, though, I learned a number of different ways that a security system can be built. One of my favorite ways to build authorization systems is through the use of role-based security.

The idea is fairly simple: you assign users to roles and roles have permissions. That way you have a nice abstraction that people can be assigned to, as a role, so that you don’t have to assign the same 5, 10, or 500 permissions to every user in your system. Don’t Do Role-Based Authorization Checks; Do Activity-Based Checks. Edit fiddle. Dynamic LINQ Queries with Expression Trees.

It's possible to build up dynamic LINQ queries or queries with several conditional criteria. In fact there are several options for doing this, including the use of expression trees Like it or not, LINQ is here to stay. Dynamic LINQ (Part 1: Using the LINQ Dynamic Query Library) ASP.NET MVC: Do You Know Where Your TempData Is? « Greg Shackles.

I recently discovered that despite the fact that I’d been using the TempData dictionary in my applications, I didn’t really have a full grasp on what it was doing behind the scenes. Of course this meant learning the lesson the hard way once something stopped working like I thought it would. I only really had myself to blame since in the end it was a simple case of RTFM, but it seemed like a good opportunity to dig in and see how TempData really works. Injecting Open Graph Protocol Content Into your ASP.NET MVC Site : On All Things Web. The Open Graph protocol. Жизненный цикл Request в MVC 3 Framework приложении. Любой разработчик знает, что URL в маршрутизации MVC играет ключевую роль.

Как известно, существует стандартная маршрутизация: Exception Handling in ASP.NET MVC. ASP.NET MVC Custom Error 404 (Not Found) Page. Storing ASP.NET MVC Controllers & Views in separate assemblies. Practical ASP.NET MVC (3) tips. Compiling MVC Views In A Build Environment. Saladwithsteve. Convert images to base64 strings for HTML/CSS embedding. Храните мелкие картинки в CSS. Храните мелкие картинки, которые нельзя засунуть в спрайты, в data:image base64 в CSS — это экономит кучу запросов к вебсерверу.

Web Workbench - Sass, Less and CoffeeScript in Visual Studio.

Metro style

Aqua Bird Consulting » Better Mapping with ValueInjecter. Tech - Scripting NuGet Package Updates (ASP.NET MVC 4) MVC Foolproof Validation. The ASP.NET Singleton-per-Request pattern - SimoneB's Blog. AJAX Event Calendar (Scheduler) for ASP.NET MVC 3 in 80 Lines of Code. ASP.NET MVC 3 Service Location, Part 10: Controller Activator. Замыкания. Javascript Closures. Fancy ASP.NET MVC Image Uploader. Dependency Injection in ASP.NET MVC NerdDinner App using Unity 2.0 - Shiju Varghese's Blog.

A simple POC using ASP.NET Web API, Entity Framework, Autofac, Cross Domain Support.

Paging

MVC 4 Mobile Features. ECMA-262 » JavaScript. Ядро. Стандарт ECMA-262, 3я редакция. HTML5 Boilerplate - Пуленепробиваемый шаблон для разработки HTML5-сайтов. Dive Into HTML5. SVG Current Status. Dmitri V. Soshnikov - personal home page. YouGrade - Asp.NET MVC Multimedia Exam Suite. SharpEdge Blog - How to add OpenID authentication to your ASP.NET MVC 3 site using Janrain Engage. Frameworks Integration. Common questions. CSS. Localization. Geo coding. EF. oEmbed. Делаешь веб-сервис? — Делай и oEmbed. Douglas Crockford's Javascript. Dynamically resize visible text and append dot dot dot (like gmail subject lines.. ) how to question? - comp.lang.javascript. Best Practices for ASP.NET MVC - ASP.NET and Web Tools Developer Content Team. The Opposite of the NOSCRIPT Element (YesScript? / ScriptOnly?)

Patterns & practices Web Client Developer Guidance. Tips and Tricks - Meta-Me.

Authentication

Facebook Integration.