First time at my blog? Check out the table of contents! x

Many of you use Subversion as your version control system. I’ve been working on setting up a copy of svnquery, which is basically a search engine for your repository. If you download the compiled version, you may run into this particular ASP.NET error:

The file '/svnquery/Query.aspx' has not been pre-compiled, and cannot be requested.

After trying many many things to solve this problem, I finally figured out that the compiled version that you download from the project website is compiled as 32-bit. And when you try to run it on 64-bit Windows Server 2008, you will run into this problem.

If you have admin access to the web server, then the easiest solution is to turn on 32-bit compatibility mode. This is done by opening up a command prompt and running this command:

%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.enable32BitAppOnWin64:true

Enabling 32-bit mode allows worker processes to run in 32-bit or 64-bit mode independent of each other on the same server.

 

Technorati Tags: ,,,

Another nice read for DotNetNuke enthusiasts!

image

I recently had the pleasure of reading a copy of the new [PACKT] publication Building Websites with DotNetNuke 5 by Washington and Lackey. This book covers a variety of topics related to DotNetNuke. You first read about the essentials of working with the portal. Topics such as installation, configuration, and portal administration are covered. This book also goes on to covers several advanced topics. You will read about how the DotNetNuke framework functions from an ASP.NET perspective. From there this book teaches you the essential concepts you need to know in order to apply your ASP.NET programming knowledge to create custom DotNetNuke modules.

For the DotNetNuke portal administrator

If you are not a programmer, then don't worry. There is still a lot of good information for you in this book. This book includes a fresh new tutorial on installing and configuring DotNetNuke. I was delighted to see that these instructions show you how to install the latest version of DNN on the latest and greatest version of the Microsoft stack (DNN 5, IIS 7.5, SQL Server 2008, and Windows Server 2008). If you're not exactly the most tech-savvy portal administrator, then this information might in and of itself justify the purchase of this book.

For those of you that are completely new to DotNetNuke, you will find a very quick informative overview of most of the standard modules that DotNetNuke ships with. At the very least, this book will give you a good understanding of what your portal is capable of. After reading the book, you should be feel comfortable enough to immediately begin using the standard modules.

For the DotNetNuke programmer

As I said in the intro, this book covers a lot of material that a DotNetNuke module programmer will find useful. If you are a programmer, you will want to dive into chapter 6 right away. You're going to learn about how pages get stored in the database, how they get identified with a URI, and finally how they are constructed dynamically. Within chapter 7 you will read all about the key classes included in the DotNetNuke framework which are essential for programming modules as well as leveraging the built-in power of the DotnetNuke core architecture.

Overall, I think this book does a good job identifying the topics that are import for an ASP.NET programmer to be aware of. Any programmer worth their weight in salt should be able to take chapters 6,7, and 8, and be on their way and programming their first custom module.

Overall Thoughts

As I've said over and over again: The world needs more DotNetNuke documentation. I personally have learned something new from every single DotNetNuke book that I've read. And this book is no exception. For instance, this is probably the first book that demonstrates how a Silverlight app can interact with your DotNetNuke site. And as I alluded to earlier, this book has updated information regarding installing and configuring DotNetNuke on the latest Microsoft software.

You should definitely add this book to you library. I also would highly recommend adding all of the other DotNetNuke books to your library as well. Because the information is hard to come by.

Buy this book now from Amazon.com

You can also order the book from [PACT]

 

Technorati Tags: ,,

Last week Carl Franklin and Richard Campbell of the .NET Rocks! podcast dropped in to “perform” a gig over on Duke campus here where I live in Durham, NC. It was the next to last stop on their road trip.

The gig was great. Good (free) food and good presentation about load testing and silverlight in Visual Studio 2010.

But let’s cut to the chase. Carl promised me a free DNR coffee mug if I posted about the event. So this is it! Here is you post Carl!

And now – I present to you – Carl Franklin on guitar and vocals!

image

And btw, you can listen to the show they recorded live – Show #556 with Brian Harry

A while back when Adobe released version 10 of their Flash plugin, many many actionscript programmers freaked out when they could no longer user the FileReference class to automatically open a save dialog. In version 10, Adobe put in place “security” changes that required a user to explicitly click in order for the FileReference class to do its thing. (see Understanding the security changes in Flash Player 10)

Well today I found a work-around that none of my peers had seen before, so I’d like to share it with you.

The Content-disposition Header

Have you ever wondered how some websites are able to tell a browser to “save” a file (open up a save dialog) rather than to display a file? One way to do this is to send a special header from the server called “Content-disposition.” This is the key to getting around opening a save dialog without the user clicking. To read more about Content-disposition, read this nice article from Microsoft – How to raise a “File Download” Dialog Box for a Known MIME Type.

How to get around the limitation of Flash 10

So here’s the idea. In your actionscript code, you already have the name of the file you want to pop open a dialog for the user to save. Normally (in Flash 10 and beyond) you would need the user to click first, and then you would use the FileReference class to pop open a dialog. But we don’t want to require the user to click. Rather, we will tell javascript to navigate the page to a script that send Content-disposition: attachment. Since it is an attachment, the browser doesn’t navigate away from the flash site. Instead, it pops open a dialog window to save the file that is sent back from the script.

The Actionscript

public function DownloadFile(fileURL:String):void{
     ExternalInterface.call("window.location=\"download.ashx?fileName=" + fileURL + "\"");
}

This function accepts the name of the file you want to download and sends a simple line of javascript via external interface. No big deal.

The Server-Side Script

I’ve been a big fan of generic HttpHandlers lately, so that is what I used. You could just as easily use php, ruby, or normal asp.net for this. The main thing you need to do is set the Content-disposition header, and then send the file you need as the response. The following is the content for the file called download.ashx:

<%@ WebHandler Language="C#" Class="download" %>

using System;
using System.Web;
using System.IO;

public class download : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        
        // grab the name of the file we need to send out
        string filename = context.Request.Params["fileName"];
        
        // read the file into a byte array
        byte[] bytes = File.ReadAllBytes(context.Server.MapPath("files/" + filename));

        // clear the headers
        context.Response.ClearHeaders();
        // clear ouat the response
        context.Response.Clear();
        // set the Content-disposition to attachment and 
        context.Response.AddHeader("Content-disposition", "attachment; filename=" + filename);
        // set the content type - might not be image/jpeg for you
        context.Response.ContentType = "image/jpeg";
        // send the content out
        context.Response.BinaryWrite(bytes);
        // end the response
        context.Response.End();
        
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }
}

And The Point Is

The point here is that you can use javascript to call a server-side script that sets the Content-disposition header to attachment. This in effect produces a save-dialog window similar, if not identical to the dialog that gets opened by the FileReference class in actionscript.

Furthermore, you can call this simple javascript line from within actionscript using ExternalInterface, and this call does not require user interaction.

I hope this helps!

 

This is the second part of the Glen Rhodes animation section in my Silverlight Math Creativity blog series. In today’s post I recreated several more of Rhodes’ flower animations. To view the first half of the flower animations, go read my previous post from the series. If you want to start at the beginning of the series, you can check out the first post here.

Flower Version 8

In this version of the flower animation I elongated the petal and changed the fill and stroke colors using Blend. The animation code changed slight as well. The rotation speed of the petal is now set to a random value between –2 and 2, so petals are rotating clockwise and anti-clockwise.

image

Click here to view the animation.

Click here to download the source code.

 

Flower Version 9

In this flower animation the petals do not rotate. This causes the petals to shoot straight out from the center. The opacity and scale get animated though, so ever frame each petal gets larger and more transparent.

image

Click here to view the animation.

Click here to download the source code.

 

Flower Version 10

In this animation the starting scale of each petal varies randomly between 0 and 1. I also set the max scale to be 2, which allows the petals to take up the entire screen.

image

Click here to view the animation.

Click here to download the source code. 

 

Flower Version 11

I wasn’t quite able to replicate what Rhodes describes for version 11. In his example he manages to keep the petals very small while they rush past you. Since the scale of the petal has to increase in order for the petal to be farther from the center, I don’t see how you can keep the petal small w/o changing the logic of the animation entirely.

image

Click here to view the animation.

Click here to download the source code.

 

FIN

I will be wrapping up the Rhodes flower section of the book in my next blog post. Stay tuned!

 

Technorati Tags: ,,

Who Is Rafe

rafe

Rafe Kemmis

I am an audacious web developer with a double bachelor of science in Computer Science and Mathematics. I specialize in Microsoft ASP.Net, Silverlight, and Adobe ActionScript.

Questions?

Always a thoughtful response. You may post your question on an article, or contact me directly.

Hire Me.

I provide custom solutions to complex problems. I can help your business no matter how large or small.

Contact me now.

Subscribe