Exploring the depths and potentials of ASP.NET RSS 2.0 or Subscribe to .BenRush by Email
 Sunday, July 01, 2007

I'm a consultant, and as a consultant I spend a great deal of time concerning myself with the "next job". I may not always be a consultant (I don't believe it's related in any way shape or form to my eagerness to be one, just that times change, etc) but for the time being I am one and so must constantly be on the outlook for the next great "gig".

How do you go about getting a consulting job? Well, for me the challenge is my locality. I'm located in Nebraska which, for the most part, is a relatively barren wasteland for modern technology. Most of my "gigs" have been acquired through word of mouth and diligence on my part to help people in times of need when they requested it - you treat someone well and they'll treat you well back, it's the basic law of the land.

First - I would not look on sites like rentacoder.com. I have tried it, and I don't like it. Why? The reason is simple, for the most part people you will find on rentacoder (on both ends of the spectrum: developer or "buyer") are unrealistic. It's not their fault; they're not "stupid" in any way shape and or form, they're just somewhat naive about the nature of software and how much it costs to develop something correct. Take this for example: say you find someone on there who bids for a full-featured ASP.NET site for $20.00 (I've seen it); chances are they will be back bidding again in a month or two to correct the myriad of mistakes the $20.00 wunderkind caused.

Oh well.

Second - I would join local organizations, clubs, etc. and become active members of them and rub elbows with business-folk. One thing we, as developers, are relatively poor at is communicating with the outside world. You can make a business person fall in love with you if you express, in some way, an appreciation for their situation and, especially, a firm understanding of it. At the end of the day everyone is out for the same thing in business: to make money. Being an active member of this world will clue business people onto you as someone who "understands" the needs and processes of real-world business software. Remember, the stereotype most business dudes have of us is that we're cowboys - loose cannons who sleep by day and hack by night. For the most part they treat you as a risk - you wield a black magic that they do not understand; do not use this force for evil, use it for good.

Third - Do things with the end in mind. You have a choice as to whether you get yourself certified as a Microsoft developer or master your latest XBOX game. Look at your resume' and think about what it says about you - as a person. Does it project someone willing to explore the depths of a project for someone, or not?

Fourth - have a reachable presence. I'm not promising I'll be doing this consulting stuff in a year, but I am promising that as I continue to write, and continue to learn, I will continue to grow my presence/influence wherever and however I can.  This means things like blogging, speaking, writing for magazines, etc. The first step is always advertising your presence because without a presence you cannot be reached, period (well, duh).

Fifth - try your damndest to say atop of the needs of your area. Note how I say, "Of your area" - this is extraordinarily important. Areas differ on their needs and requirements for software; different places require different talents - you will succeed if you have a good rap sheet and expertise on those needs. Consider that and ask around, talk, discover, etc.

...I think the most important thing to take away is opening the lines of communciation, being accessible and being real. Believe it or not, but if you can make those things happen you can probably (probably) make it as a software consultant.


kick it on DotNetKicks.com
Sunday, July 01, 2007 4:16:27 PM (Central Standard Time, UTC-06:00)  #    Comments [7] - Trackback
Computing | Programming | Ranting
 Wednesday, April 04, 2007

Say you have a master page and content page scenario, and from the content page you want to interact with DOM elements described from the master page (for example, the main body element). This is how I do it:

First, add the following attributes to your body element so that it is included in the server-side runtime and can be interacted with from there:

<body id="mainbody" runat="Server">

...notice how the body element now has an id and has the runat="server" attribute set.

Second, from code within the content page (I'm doing it in Page_Load) add code like this:

    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlGenericControl ctrl = (HtmlGenericControl)this.Master.FindControl("mainbody");
        ctrl.Attributes.Add("onload", "alert('hello');");
        return;
    }

The key here is to now grab the body element, add some script to it, and then let it all run as normal. When I run the solution, the content page is loaded, its Page_Load called, the script injected into the body element (of the master page) and I see "hello".

Recommended reading:

kick it on DotNetKicks.com
Tuesday, April 03, 2007 11:47:56 PM (Central Standard Time, UTC-06:00)  #    Comments [2] - Trackback
AJAX | ASP.Net | Computing
 Tuesday, July 04, 2006

The June CTP of "Atlas" is out; I'd recommend downloading it if you're into that sort of thing.

The biggest change in the release is that you now have the ability to dynamically create and use UpdatePanel controls - this opens up the capability to use them in templated scenarios such as in GridViews, DataGrids, Repeaters, etc. The change the CTP made wasn't to "add" dynamic UpdatePanel controls, but to relax a constraint which pinched when Triggers had to reference the UpdatePanel.

Triggers are the feature of UpdatePanels which allows them to be connected to controls outside their content template region; that is, if the UpdatePanel surrounds a bunch of controls, but wants to also be "notified" when a control outside itself causes a post back, then it must use a Trigger (out of the box there are two types of triggers: those which update a panel when a control raises an event, and those which update a panel when a control's value changes). This is useful if you have a region that surrounds controls that must be asynchronously updated in the browser, but the control that causes the asynchronous update is  off somewhere else on the page (such as a submit button, et al).

When the client "fires" the trigger, the posted data comes back asynchronously and is retrieved/analyzed on the server during the load post data event in the page's lifecycle - which just so happens to occur before the Load, PreRender, etc. events. When the posted data is recieved on the server, the code immediately attempts to link the posted data of the trigger to an UpdatePanel in memory. But - for many controls that support templates - this is too early for an UpdatePanel control which resides within them to have been instantiated. Therefore - no UpdatePanel is found and the post back results in no change on the client....this is the constraint that was changed.

Now, as of the June CTP, you can add UpdatePanel's dynamically to a page - which means they can be inserted at any time and can therefore be a part of the template of GridViews, etc. The most blatant change which powers this new ability occured in the RegisterUpdatePanel public method of the ScriptManager object - a method called by the OnInit method of the UpdatePanel to register itself with the ScriptManager. Whenever the UpdatePanel is instantiated on the page it must register itself with the ScriptManager so that post back events can be filtered to it proxy the ScriptManager (recall that the ScriptManager is basically the king of all controls on the page). What changed in this method is that it now references two variables which are set during the load post data phase of the page lifecycle by the ScriptManager as a "this is what happened during that phase" diary for UpdatePanels that may come about later.

The first of the two new variables referenced in the RegisterUpdatePanel method stores the unique identifier for the UpdatePanel sent to it by the client if that panel isn't found by the time the load post data event occurs. The second is a boolean flag which gets set to True when the load post data phase has completed to prevent duplicate operations on the control (double initializations). Here is the code:

public void RegisterUpdatePanel(UpdatePanel panel)
{
   if (panel == null)
   {
      throw new ArgumentNullException("panel");
   }
   if ((this._allUpdatePanels != null) && this._allUpdatePanels.Contains(panel))
   {
      throw new ArgumentException("This UpdatePanel has already been registered.", "panel");   
   }
   if (this._allUpdatePanels == null)
   {
      this._allUpdatePanels = new List<UpdatePanel>();
   }
   this._allUpdatePanels.Add(panel);
   if ((this._updatePanelRequiresUpdate != null) && (panel.UniqueID == this._updatePanelRequiresUpdate))
   {
      if (panel.Mode == UpdatePanelMode.Conditional)
      {
         panel.Update();
      }   
      this._updatePanelRequiresUpdate = null;
   }
   if (this._panelsInitialized)
   {
      panel.Initialize();
   }
}

When the load post data phase has completed, and the update panel which caused the post back event on the client wasn't found, the _updatePanelRequiresUpdate variable is set to the unique id - in addition the _panelsInitialized boolean is set to true. When an UpdatePanel is instantiated dynamically at a later time, its OnInit method will be called by the page framework (when you add a control to a control collection, one of the operations done to the control is to have its OnInit method called since it wasn't around when the whole page trickled the event down to its child controls). The UpdatePanel's OnInit method calls RegisterUpdatePanel, which now has the unique identifier of the newly instantiated panel control to check against the _updatePanelRequiresUpdate variable. If the identifiers match and this new control's mode is conditional, then the panel is explicitly updated. Regardless, if the Initialize method was called for all early panel's on the page already, then the newly instantiated control has it's Initialize method called thanks to the _panelsInitialized boolean.

As a result...dynamically created UpdatePanels are now possible.


kick it on DotNetKicks.com
Tuesday, July 04, 2006 11:14:13 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing
 Monday, June 26, 2006

Okay - so I lied - one more post before I take a walk.

Check this out: http://msdn.microsoft.com/winfx/.

WinFX, right? No. .Net 3.0. Huh?

Okay - all I'm saying is that I want Indigo back; I actually liked the name Indigo, especially in comparison to the prolix "Windows Communication Foundation". I want Indigo. I also loved the name Avalon. Longhorn? Not so much - I think Vista sounds better. But doesn't Vista, Indigo and Avalon go well together? WinFX was cool to say too. Why are they trashing these cool names and giving them corporate sounding, winded names?

Perhaps I should make a button or web banner that says, "I miss Indigo". I wonder if it's because they believe it'll be more palatable by the corporate nimrods? But - seriously, what does Windows Communication Foundation give us if I'm seeing "WCF" everywhere anyway?

 


kick it on DotNetKicks.com
Monday, June 26, 2006 12:48:54 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing | Ranting

I just got a new book the other day called, "the Pragmatic Programmer" and I'm looking forward to diving into it when I get my article submitted. The fundamental idea behind the book, from what I can tell, is how to make yourself a practical developer of software - yes, that's right: a pragmatic programmer (go figure, eh!?). I believe many developers I encounter are not pragmatic (or pragmatic enough). Why? I believe it's about ego - though I'm not sure. I haven't read a damn bit of the book yet (and may I say *damn* again, because quite frankly I wish I would have more time to do so), but I will be posting thoughts as I read through it.

It's a beautiful night. I think I'm going to take a walk and hit the sack...the voices in my head are speaking in XPath expressions.  


kick it on DotNetKicks.com
Monday, June 26, 2006 12:38:25 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing
 Friday, June 23, 2006

I finished the rough draft for the article this afternoon and my compadres are going through it, looking for mistakes et al. I may take a break this weekend from anything related to technical writing - so if you don't see me for a day, that's why :P


kick it on DotNetKicks.com
Friday, June 23, 2006 2:16:56 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing
 Thursday, June 22, 2006

I'm working on another article. I'm hoping to have it done within the week and start looking for people to publish it (I'm aiming for MSDN this time). So - that's where my spare mental CPU cycles have gone....


kick it on DotNetKicks.com
Thursday, June 22, 2006 4:24:57 PM (Central Standard Time, UTC-06:00)  #    Comments [1] - Trackback
Computing
 Friday, June 16, 2006

The conference is over and I'm really, really, really ready to get back home. I'm tired and my brain is full. I'll probably take a couple days to digest some of the information I gathered from the conference and hopefully have some interesting content to put up....see you all in a couple days....

 


kick it on DotNetKicks.com
Friday, June 16, 2006 8:34:47 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

Computers Blogs - Blog Top Sites

Archive
<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Benjamin Rush
Sign In
Statistics
Total Posts: 444
This Year: 0
This Month: 0
This Week: 0
Comments: 127
Themes
Pick a theme:
All Content © 2008, Benjamin Rush
DasBlog theme 'Business' created by Christoph De Baene (delarou)