Home / ASP.NET Weblogs

March 2012 - Posts

Posted to:

Overriding the Pager rendering in Orchard

The Pager shape that is used in Orchard to render pagination is one of those shapes that are built in code rather than in a Razor template. This can make it a little more confusing to override, but nothing is impossible. If we look at the Pager method in CoreShapes, here is what we see: [Shape] public IHtmlString Pager(dynamic Shape, dynamic Display) { Shape.Metadata.Alternates.Clear(); Shape.Metadata.Type = "Pager_Links" ; return Display(Shape); } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff;...
Filed under: ,
Posted to:

ZenGallery: a minimalist image gallery for Orchard

There are quite a few image gallery modules for Orchard but they were not invented here I wanted something a lot less sophisticated that would be as barebones and minimalist as possible out of the box, to make customization extremely easy. So I made this, in less than two days (during which I got distracted a lot). Nwazet.ZenGallery uses existing Orchard features as much as it can: Galleries are just a content part that can be added to any type The set of photos in a gallery is simply defined by a folder in Media Managing the images in a gallery is done using the standard media management from Orchard Ordering of photos is simply alphabetical order of the filenames (use 1_, 2_, etc. prefixes if you have to) The path to the gallery folder is...
Filed under: , , ,
Posted to:

ASP.NET MVC 4, ASP.NET Web API and ASP.NET Web Pages v2 (Razor) now all open source with contributions

Happy Tuesday! It's indeed a happy day as I am (literally this moment) at a conference in Las Vegas and have just pressed Publish on this blog post to announce that we are open sourcing ASP.NET MVC 4, ASP.NET Web API, ASP.NET Web Pages v2 (Razor) all with contributions under the Apache 2.0 license. You can find the source on CodePlex . Be sure to read all the details on ScottGu's blog . Ya, I bolded, underlined and italicized that last part and yes, it was gratuitous. Fight me. ;) This is the culmination of a lot of hard work by a lot of folks in our organization. It's the very reason that I came to work at Microsoft. So, what’s happening here? While the source for ASP.NET MVC has had source available since its inception, and converted...
Posted to:
by: 
03-27-2012, 8:02 PM

ASP.NET MVC, Web API, Razor and Open Source

Microsoft has made the source code of ASP.NET MVC available under an open source license since the first V1 release. We’ve also integrated a number of great open source technologies into the product, and now ship jQuery, jQuery UI, jQuery Mobile, jQuery Validation, Modernizr.js, NuGet, Knockout.js and JSON.NET as part of it. I’m very excited to announce today that we will also release the source code for ASP.NET Web API and ASP.NET Web Pages (aka Razor) under an open source license (Apache 2.0), and that we will increase the development transparency of all three projects by hosting their code repositories on CodePlex (using the new Git support announced last week ). Doing so will enable a more open development model where everyone in the community...
Filed under: , , ,
Posted to:

Unhandled exception has occurred while running in Azure

Windows Azure, just like any other IIS website can crash if an unhandled exception occurs.  One way that this can happen is if you are calling an Async function call and in the function that is called on completion, you throw an exception. In this situation, you will see something in the Application event log that looks like this:      Note : you may not see both of these errors but either or both of them point to the same problem. The way to resolve this issue is to either wrap the code inside a Try/Catch block and catch the exception or see what is causing the exception and fix that bug.  But if a block of code can throw an exception, it is always good to wrap it so that it can’t cause the entire process to crash...
Posted to:

Visual Studio 11 Express Beta for Web new features

In earlier blog , we mentioned that Visual Studio 11 Express Beta for Web is available to download. Besides the common features seen in Visual Studio 2010 Web Express, it provides some new functionalities. TFS support VS11 Express Beta for Web added TFS support which including all of the TFS client features, such as source control, team explorer tool window, work item etc. It works with TFS 2010, Visual Studio 11 Beta TFS , and http://tfspreview.com/ . Unit test With VS11 Express Beta, you can create a unit test project into an existing web solution. Unit test explorer is fully functional to run unit tests and view results. MVC4 Beta MVC4 Beta templates are included in VS11 Express Beta for Web as well. When creating a MVC4 beta project with...
Posted to:

Extending the Visual Studio 11 Web Browser Chooser and Browse With Menu to include Developer Profiles

I talked about some new features that have snuck made their way into the free version of Visual Studio for Web . One of the more useful ones is the Browser Chooser that allows you to quickly launch debug sessions with different browsers from within VS. I've actually been pushing on this for about 18 months, and even blogged about it in August of 2010 in " how to change the default browser in Visual Studio programmatically with PowerShell and possibly poke yourself in the eye ." In Visual Studio 11 Beta you get a nice dropdown with all the browsers (plus the new Page Inspector ). However, I got a good comment from blog reader Abhijit who said: The browser is a welcome addition (though past versions of VS do something similar). I'd...
Filed under: ,
Posted to:

Features NO ONE NOTICED in Visual Studio 11 Express Beta for Web

There's a bunch of new stuff in Visual Studio 11 Express for Web that I suspect not everyone noticed. Remember that Express is our free version of Visual Studio. Sometimes I hear folks complain that Express isn't advanced enough, even though its free. Unit Testing is Built-into Visual Studio Express For example, no one noticed that Unit Testing is in Express. You can add a Unit Test to an existing Web Solution. I'll add a Unit Test Project, the right click on References and add a reference to System.Web.Mvc to my ASP.NET MVC Application. Note the new Add Reference dialog? It's got a search box, it's multi-threaded, and I can add multiple references by checkbox. That's new stuff, friends. Subtle, but it is one of those...
Filed under: ,
Posted to:

Join us online on April 24 for the patterns & practices Symposium 2012

Join us live on April 24th for our first ever online live streamed patterns & practices Symposium! Register at eventbrite to ensure you can attend and participate (and, of course, to help us gauge attendance so we can properly scale the streaming for the best experience). The April 24th online p&p symposium program 2012 will include keynote sessions and technical sessions focusing on building scalable applications in Azure, mobile development, node.js, CQRS, .NET Gadgeteer and a general overview of p&p roadmap. All sessions will be streamed live on Channel 9, and then made available for download later for people who couldn't participate (or who want to watch it again) The eventbrite registration site has the full and current...
Posted to:

Drawing transparent glyphs on the HTML canvas

The HTML canvas has a set of methods, createImageData and putImageData, that look like they will enable you to draw transparent shapes pixel by pixel. The data structures that you manipulate with these methods are pseudo-arrays of pixels, with four bytes per pixel. One byte for red, one for green, one for blue and one for alpha. This alpha byte makes one believe that you are going to be able to manage transparency, but that’s a lie. Here is a little script that attempts to overlay a simple generated pattern on top of a uniform background: var wrong = document.getElementById( "wrong" ).getContext( "2d" ); wrong.fillStyle = "#ffd42a" ; wrong.fillRect(0, 0, 64, 64); var overlay = wrong.createImageData(32, 32), data...
Filed under: , , ,

1 2 Next >

Archives