-
The This in this
There are many churlish titles that I could use for this post, but for now I'll moderate my juvenile sense of humor. Today I'm just going to show a simple JavaScript function that pokes around a 'this' to see what it smells like. First off I'm not really planning to go to the level of the ECMA Script specs, nor really am I planning a thorough explanation of the object-like structures of JavaScript functions. I'm going to cover the basics of understanding context, and how to use it, and how it can cause headaches at some point. For a more...
-
FindComponent
I'm taking a few posts off from my Domain in the Box series mostly because I'm taking the time to move my data from a bunch of static methods in code to a nice neat like Sql Data File (.sdf) in VS 2008 Beta 2 (did I mention that I'm sold, really sold on Beta 2). That's going to be a tedious process that will take a few days, so when I'm done I'm going to pick that series up once I'm a little farther along with the move. In the interim I'm going to address a few short topics...
-
Domain in the Box Part 5
Next on the docket is a rough outline of the University Domain area. Basically it will look something like this (sometimes those class diagrams are pretty handy).
But here's another set of tough choices to make along the lines of Parentage. For instance, are the People a property of the University, or College to which they are associated? Probably not, but the only way to tell would be to get some more clarification on how this data is likely to be used by my eventual fictional application.
If this system were to back a national university ranking system, it...
-
Domain in the Box Part 4
Roles? This is definitely one of the areas I've had the most trouble with when I try to understand my fictitious Plebian U Domain. In my original model, roles defined both a person's relationship to the University either employee (of a specific type ex, Professor, Adminstrator, GroundsKeeper etc) or student (graduate, undergrad, post-grad), and status/ fulltime and part time. On my original person object there was no concept of a Roles list (it was build on .Net 1.1, so no generics). The way I had built my layers, the BLL would call into the DAL with a specific RoleID and...
-
Wild Wild Web
This is a little interruption to cover something that's on my mind a lot lately. One of the more interesting attributes of a truly good web developer is design based on what's possible. The web is a much more fickle place than a database. There are hard predictable albeit often confounding reasons that govern the way databases work. The web, while still mostly governed by reason and known rules of invocation, has an edge of unpredictability. Partly this is due to differing interpretations of standards "compliance" helped along for better or worse with Microsoft's strong...
-
Domain in the Box Part 3
So how to handle contact info, do I make a "type level" domain object like an Emergency or Home, or do I save that sort of logical grouping for the Business layer. Truthfully I've already made up my mind. The domain layer I'm updating doesn't make any groupings, and here's why. Essentially I tried to look at the domain objects as whole entities onto themselves. An email address really has nothing to do with a mailing address, and any association like "emergency" is purely a matter of interpretation. Another way to look at it is I didn't really want my...
-
Domain in the Box Part 2
*** Note I'm doing this post series using Orcas Beta2. So most of my code samples will be using whatever new baked in goodness I can garner from new VS. So far I'm really amazed with this release of VS 2008, aside from awesome JavaScript Intellisense, and a generally lighter, faster feel, the big thing for me is that the 2 Deal Breaker issues I've had with the VS Unit Testing facilities have been fixed. As A long time TestDriven.Net user, It was an absolute requirement to have a right click Run Tests, that would either execute a full TestFixture...
-
Domain in the Box Part 1
This post series is going to cover the creation of a fairly simple creation of a set of Domain objects to cover the needs of a fictional Plebian University. The goal will be to create a set of Domain objects that will service a "tracking system" that encapsulates the management of people and facilities for this university. The set of posts will be centered on the Domain objects but we can't really fully develop those objects without knowing a little about how we want to approach persistence and how we want to handle business logic.
Sure there are hundreds...
-
Making the most of out the AjaxControltoolkit’s ModalPopupExtender Part 9
Okay, so why not just stick inside the toolkit and use the DynamicControlID / DynamicServiceMethod. Why futz around with all this extra work when there's a perfectly fine built in functionality that will do just about everything I need it to. Well, first, it's not quite what I need, this is one of those cases where, if you just want a ModalPopup, not a ModalDialog things will be very good for you. Unfortunately there are some problems. Let's look at this over simple example
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
<div>
<asp:Button ID="ShowModal" runat="server" Text="Show" />
<cc1:ModalPopupExtender ID="ModalPopupExtender1"...
-
Making the most of out the AjaxControlToolkit’s ModalPopupExtender Part 8
This is the second to last post in this series, and basically this is just going to be some trace.axd output comparing a WebMethod populated Modal Dialog with an Update Panel generated dialog. Instead of the really basic UI I've been using to prototype some of this code, I'm going to use a simple Grid/Detail setup using an asp:repeater combined with the modal popup to view the details. I'm going to use a Customer/Location Domain/DAL setup that I've got floating around (see here for what I'm talking about). I'm not going to include code in this post,...
-
Making the most out of the AjaxControlToolkit’s ModalPopupExtender Part 7.1
One of the most useful things for a developer to have in their bag of tricks is a bevy of canned sample code. Having a simple project of Domain objects, as Simple DataAccess project that pulls static data, or reads from an included data source, a Business logic layer, and a simple UI (the more platforms the better) to render the Domain objects can save hours when you want to do a quick proof of concept on a new technology. Say you want to see what this new LINQ stuff is all about, grab your DataAccess,...
-
Making the most out of the AjaxControlToolkit’s ModalPopupExtender Part 7
In this post well look at the some Trace.axd and Fiddler/FireBug output to see what kind of work we are doing to generate the dynamic content inside of the modal update panel. Additionally the some modifications to the code listed here are listed below to integrate the WebMethod dynamic contend within the scope of a ModalPopupExtender.
Right of the bat, I have to admit that using the WebMethod version's Trace.axd output compared to the UpdatePanel's Trace output is entirely unfair. The issue is that the Control creation work handled by the AjaxControlRender is not listed in the output,...
-
Making the most out of the AjaxControlToolkit’s ModalPopupExtender Part 6
Pros and Cons.
When it's all said and done, no matter what you start out thinking you are in for, when it comes to the wonderful world of Ajax, things just wont work exactly how you expect them to. Unlike much of the world of web programming, there's the gorilla of compromise that makes it presence felt without fail.
From subtle CSS-purgatory nuances, to the predictable unpredictability of end users, be prepared for a fair amount of hand tuning if you want a truly robust dynamic web experience. This brings several new problems into play when developing a full fledged user...
-
Making the most out of the AjaxControlToolkit’s ModalPopupExtender Part 5
This Post is also very code heavy and detail light. Instead of spreading the code out for this step, I'm going to just put a large number of code listings at the bottom. In the last post we got a very basic dynamic modal working, that allowed us to push data back and forth between to controls hosted in a Modal dialog. For this next pass I want to leave the modal dialog out of this all together and break into some code using WebMethods.
First, it's a very legitimate thought that I should really be using creating an Extender...
-
Making the most out of the AjaxControlToolkit’s ModalPopupExtender Part 4
Let's dive right into putting the ControlLoader and ControlLoaderManager to work. Well go back to our simple modal dialog first covered here and make some changes
Here's the form markup
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<Controls:ControlLoaderManager ID="MainLoader" runat="Server" />
<div>
<asp:Button ID="ShowModal" runat="server" Text="Show The Modal" />
<asp:Button ID="DummyOkayControl" runat="server" style="display:none;" />
<ajaxToolkit:ModalPopupExtender
ID="ModalPopup"
runat="server"
TargetControlID="ShowModal"
CancelControlID="CloseButton"
OkControlID="DummyOkayControl"
OnCancelScript="OnCanceledHandler();"
OnOkScript="OnOkayedHandler();"
PopupControlID="ModalContentWrapper"
PopupDragHandleControlID="DragHandle"
RepositionMode="repositionOnWindowResize"
DropShadow="false"
>
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="ModalContentWrapper" runat="Server">
<table width="600px" border="0" cellpadding="0" cellspacing="0" class="Modal">
<tr>
<td style="width:580px" colspan="2" class="Modal" id="DragHandle" runat="server">
<img src="images/spacer.gif" width="580px" height="20px" alt=""/>
</td>
<td style="width:20px"><asp:Linkbutton ID="CloseButton" runat="server" CssClass="CloseButtonStyle">X</asp:Linkbutton></td>
</tr>
<tr>
<td style="width:20px">
<img...
-
Making the most out of the AjaxControlToolkit’s ModalPopupExtender Part 3
This post will cover the ControlLoader. This custom control extends the PlaceHolder to prove some more intelligence around loading a control. One of the primary concerns when using dynamically loaded controls is trying to work peacefully with the natural page lifecycle. The first snag often hit is that on Postback if a control want's to participate in the ViewState rehydration and normal Control Eventing, it needs to be added to the control tree at OnInit. This is usually not too much of an issue, unless you need information from the post to tell you which control to load. If you...
-
Making the most out of the AjaxControlToolkit’s ModalPopupExtender Part 2
One of the niceties or curses of the Ajax Framework is that it allows development of Ajax Enabled pages in a pattern that is very familiar to most ASP.Net developers. The plus side is obviously that for many basic tasks, the learning curve is very light when it comes to Ajaxifying a web page. The downside includes things like diminished responsiveness, unintended data state persistence, and from the UI's perspective, if an UpdatePanel is involved, there's a minor detail about only being able to process one asynchronous request at a time.
That said, I'm going to dedicate the next 3...
-
Making the most out of the AjaxControlToolkit’s ModalPopupExtender Part 1
The basic challenge here is how to give the ModalPopuExtender all the flexibility of a popup window. A lot of the functionality is build in using the DynamicControlID, or DynamicServiceMethod attributes, but unfortunately that approach didn't serve the needs of the project. The main constraint was to "skin" the dialog once, and replace the center div's content only dynamically based on the requested function.
I'm going to make 2 passes at this, the first using an UpdatePanel nested in the Extended Panel, that will allow me to swap content on the fly. I'll cover the shortfalls of this, and how...