Jakew
Consulting, hacking, and motorcycles

test

Thursday, 29 March 2007 14:52 by jakew
test
Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Web Client Software Factory Authorization

Sunday, 25 March 2007 17:20 by jakew

Here I want to explain how you can use the authorization principals built in the websf factory. One of the first things I wanted to do when I started experimenting wih the factory was try to implement some the security features that we use in our real world applications.

I mean all of the applications that I have worked on (as far as I can remember) have had security features and the security features were database driven. I.e the roles, rules, users, etc.. all this information is stored in a database.

Out of hte box the reference implementations and samples for the factory all used the web.config files to demo the features...hardly helpful.

So I set out to figure out and understand what the P&P group had already done as far as security and then implement a database driven security features.

 

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Web client software factory 101

Sunday, 25 March 2007 17:10 by jakew

I have been playing on and off with the web client software factory (wcsf from here on) since it was in the CTP stages and I have to say that personally this is one of the most important factories out there. Why?

Because I like the way it directs the way that an application is developed. I like the fact that you have to do :

some analysis and design up front.

think of the different functional capabilities that your application will provide

Seperate those different concerns into suedo use cases

Use cases further go and enable you do think in an OO way. (If you have done OO development before)

The use cases become modules.

The modules themselves allow you to just focus on those capabilities.

The modules can be plugged in.

The patterns that you use in module, like the MVP or MVC pattern (if you want) but I have used the MVC and MVP patterns before and I do everything that way now.

 

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

MS Ajax 101 Client Side

Thursday, 22 March 2007 00:21 by jakew

Why do you always drop a ScriptManager control on your page or control?

Because this is the first indication to your application that MS Ajax is going to come into play. When the form containing hte ScriptManager loads, the script manager instantiates an Application object which exposes some events that run through a full life cycle similar to a regular asp.net page.

The events exposed by the Application object are:

1. init event

2. load event

3. unload event

 

To capture these in javascript add the following AFTER the SCRIPTMANAGER tags

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="False" OnAsyncPostBackError="ScriptManager1_AsyncPostBackError" />

<script type="text/javascript" language="javascript">

var app = Sys.Application;

app.add_init(InitHandler); //the InitHandler is just the name of my method that will be used.

app.add_load(LoadHandler);

app.add_unload(UnLoadHandler);

function InitHandler(sender, args)

{

 

}

 

function LoadHandler(sender, args)

{

 

}

 

function UnLoadHandler(sender, args)

{

 

}

</script>

 

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Capturing MS Ajax errors server side

Wednesday, 21 March 2007 23:38 by jakew

To capture errors that occur when utilizing MS Ajax, we can do two things:

1. Capture the exception on the server side.

2 Capture the exception on the client side.

 In this post I will detail out how to capture exceptions using server side code. You might be asking when do I use one over the other. Good question!! But first some background.

The exception that is caught using the server side method ultizes the ScriptManager object(control) that is placed on the web page/control. So once the page loads all the events that the ScriptManager fires up are available.

Once you put an UpdatePanel control on the form, another object

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Capturing MS Ajax client side events

Wednesday, 21 March 2007 11:19 by jakew

The following are the life-cycle events raised on the client side for the PageRequestManager object:

 

PageRequestManager event

Description

initializeRequest

Raised before processing of the asynchronous request starts. You can use this event to cancel a postback.

beginRequest

Raised before processing of an asynchronous postback starts and the postback is sent to the server. You can use this event to set request headers or to begin an animation that indicates that the page is processing.

pageLoading

Raised after the response from the server to an asynchronous postback is received but before any content on the page is updated. You can use this event to provide a custom transition effect for updated content.

pageLoaded

Raised after all content on the page is refreshed, as a result of either a synchronous or an asynchronous postback. You can use this event to provide a custom transition effect for updated content.

endRequest

Raised after an asynchronous postback is finished and control has been returned to the browser. You can use this event to provide a notification to users or to log errors.

To capture them on the client side put the following in your aspx page. 

<script language="javascript" type="text/javascript">

var prm = Sys.WebForms.PageRequestManager.getInstance();

prm.add_initializeRequest(InitializeRequestHandler);

prm.add_beginRequest(BeginRequestHandler);

prm.add_pageLoading(PageLoadingHandler);

prm.add_pageLoaded(PageLoadedHandler);

prm.add_endRequest(EndRequestHandler);

 

 

function InitializeRequestHandler(sender, args)

{

 }

function BeginRequestHandler(sender, args)

{

}

function PageLoadingHandler(sender, args)

{

}

function PageLoadedHandler(sender, args)

{

}

function EndRequestHandler(sender, args)

{

window.status="ending request";

if (args.get_error() != undefined)

 {

var errorMessage;

 if (args.get_response().get_statusCode() == '12031')

 {

 args.set_errorHandled(true);

 }

 else

 {

 // not my error so let the default behavior happen }

 }

}

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

MS Ajax 101

Wednesday, 21 March 2007 10:35 by jakew

Got thrown in to the fire with this one.....but learnt more than enough to feel satisfied on how ajax works now.

 more to come....

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

The joy (agony) of getting medical

Tuesday, 20 March 2007 17:11 by jakew

My weekend is pretty much a blank to me.  There are short clips of memory from various point in time at the hospital, but what exactly came before is a mystery to me.  According to my wife we bought bicycles.  I got up early Saturday and did some yard work and then coaxed everybody out to have some fun.  At least that is what lead  to my being in a hospital bed.

 

I vaguely remember a doctor pulling on my forearm trying to reposition something.  It is going to need surgery.

 

I also recall somebody going after me with a catheter and me begging to be allowed to just go use the head.  They wouldn’t let me up because they were afraid of spinal damage.

 

I’m out of the hospital now and at home.  I hurt like a mo-fo.  One eye is black.  Not just the skin around it, the eye itself is black.  I can see just fine.

 

Now it is just a waiting game.  Waiting for stuff to heal, waiting for my energy to return. 

 

Whjat really sucks is that I’m bored.  Cant really do anything but wait

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Pushing Limits

Wednesday, 14 March 2007 22:01 by jakew
I've been working toward having my own business for the past year or two.  In some ways I've already achieved my goal - I'm an independent contractor and I don't have too much trouble finding work.  That qualifies as a business.  Not really.

What I want is to sell software and services.  What I sell now is my time.  So why haven't I converted over yet?  Being busy is only a part of the reason.  Truthfully, I could already be selling the services side and growing a business if I would just get out of my own way.

I make excuses about not knowing enough about marketing, sales and all the other stuff that goes along with business.  I went to school to learn to be a computer scientist.  I didn't study business.  I've learned a lot of economics, but economics doesn't really tell you how to run a business.  It tells you a lot about the environment businesses work in and different ways you can make a business work, but the rubber doesn't quite reach the road.  Sort of like the difference between a software architect and an actual software developer.  The architect can draw you a high level diagram of the system and everything around it.  The developer is going to know the actual lines of code inside the diagram.

Point to this is that I'm finally moving again.  My wife kicked my ass b/c I've been procrastinating for the past few months not working on my stuff.  What ticked her off was that I was on the computer (motorcycle racing forums) not really working and not spending time with the family.  Her point of view was that if I wasn't going to be doing something productive I should spend time with the family. So I'm being limited on the amount of time I spend alone in my office.  The cool thing is that it is working.  I'm getting stuff done.  I'm code complete on my first product and have moved to testing it.  I would like to get it out by May.

I'm not expecting much out of this first shot expect to learn.  Learn to setup a store front, advertise and sell.  It will be a success if I can sell one thousand copies. 

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

New rig (part 2)

Monday, 5 March 2007 22:30 by jakew

It rocks but I ended up having to take VISTA off. 

The reason, as usual apparently, is driver support.  However, I had a hell of a time getting XP SP2 on my machine b/c it doesn't have drivers for the Tyan Tempest motherboard I have.  Turned out that I had to turn off AHCI (whatever the SATA thing is) in order to get XP on my machine.  Then I had to get drivers from Tyan's site.  That in itself was an adventure.  Their drivers are hidden on an FTP server and there is no mention of it on their web-site.  Talk about fun.  Luckily JNCS helped me out.

 Overall this machine freaking flies.  I'm also done installing everything on my machine.  This go around the server stuff will live in a VPC.  I ran VPC 2007 in VISTA and it worked great so I'll do the same in XP.  Basically this means that my BizTalk and SQL work will be done on a different machine than my workstation.

 I'm also going to attempt (again) to not run as a local admin on my machine.  In some ways it would be easier to do if I was running 2003.  Then I could just RDP back on to the machine when I needed admin rights.  I'm talking to a friend about it and he bets it won't last long.  going adminless is like going on the Atkins diet - sounds great for about a week.  Then you give in to the dark side.

 

Categories:  
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed