Monday, April 9, 2007

Great introduction to StructureMap 2.0

I've always been intrigued by StructureMap and Spring.net, but I've never known really how or why I should use them. I guess I never had the visibility in their benefits, but I figured that they could come in handy at some point.

Recently Jeremy Miller released version 2 of StructureMap, but it was still hard for me to get solid examples without previous knowledge of what the tools do.

He recently posted an introduction to StructureMap 2.0, and it really helped me get a better understanding of how to use it, and I can see the benfits immediately from the examples on the intro.

I still have a few questions on overall usage, mostly around configuration since the examples that Jeremy has revolve around configuration objects and the default implementation in some sort of startup method/event. If that is the case, would I have this enormous list if declarations? Surely this could be done in a config (and I think it does, so I'll just wait and see!)...read more!

Thursday, March 15, 2007

ASP.NET Wishlist

Steven Smith has posted his wishlist for ASP.NET. He's in Seattle for the MVP summit. You can read about the items here: http://aspadvice.com/blogs/ssmith/archive/2007/03/14/ASP.NET-Wish-List.aspx.

I would like to focus my attention on a couple:
1) Recursive FindControl - Would be cool, but, as Steven mentions, there are a few functions out there that provide this. Nice to have, but dont compromise any other deliverables for this.

2) Cache Improvements - This is huge. I dont rely too heavily on Cache, but I do use it enough to say that companies like ScaleOut have stepped up to fill in the gaps that Microsoft has made. I would like to see two things out of Steven's list: Distributed Cache and a Cache Provider Model. I'd like to see the out of the box implementation have distributed cache mechanism, but also have the ability to throw in our own implementation of cache.

I'm really excited to see the next feature set of ASP.NET....read more!

Monday, March 5, 2007

Invoking an ajax/atlas modal dialog off a postback

Recently I was working on a scenario where I had to show an ajax/atlas modal dialog using ajax' ModalPopupExtender after some server side processing had been done. This was very hard because one of the control's required properties is the TargetControlID, which responds to a click event and throws up the modal dialog, all before the postback occurs.

I tried looking for a fancy way to be able to get this modal up and running by assiging some dummy control in the markup and calling .Show() to make the dialog show up, but that didn't yield me much.

I found a bit of a hack, which is pretty much creating a control (in my example, a label) on page_load, adding it to the UpdatePanel's ContentTemplateContainer's control collection, assign the ID of the dummy label to the ModalPopupExtender's TargetControlID property and then on a postback I could call .Show() on the MPE (ModalPopupExtender) and the dialog would show up as I needed it.

In the following example I am displaying the current timestamp on a label that is set off of a button click postback event.


default.aspx:



   1:  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

   2:  <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> 

   3:   

   4:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

   5:  <html xmlns="http://www.w3.org/1999/xhtml">

   6:  <head runat="server">

   7:      <title>Untitled Page</title>

   8:  </head>

   9:  <body>

  10:      <form id="form1" runat="server">

  11:          <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />

  12:          <asp:UpdatePanel ID="upShowStuff" runat="Server">

  13:              <ContentTemplate>

  14:                  <asp:Button id="Button1" runat="Server" Text="Process Postback" OnClick="Button1_Click" />

  15:                  <ajax:ModalPopupExtender ID="mdePopup" runat="server" PopupControlID="pnlShowStuff" 

  16:                  OkControlID="btnOK" /> 

  17:                  <asp:Panel ID="pnlShowStuff" runat="Server" Style="display:none">

  18:                      <div style="border:solid 1px #000">

  19:                          <asp:Label ID="lblShowStuff" runat="Server" />

  20:                          <asp:Button id="btnOK" runat="Server" Text="OK" />

  21:                      </div>

  22:                  </asp:Panel>

  23:              </ContentTemplate>

  24:          </asp:UpdatePanel> 

  25:      </form>

  26:  </body>

  27:  </html>



default.aspx.cs:



   1:  public partial class _Default : System.Web.UI.Page 

   2:  {

   3:      protected void Page_Load(object sender, EventArgs e)

   4:      {

   5:          Label lbl = new Label();

   6:          lbl.ID = "tempholder";

   7:          upShowStuff.ContentTemplateContainer.Controls.Add(lbl);

   8:          mdePopup.TargetControlID = lbl.ID;

   9:      }

  10:   

  11:      protected void Button1_Click(object sender, EventArgs e)

  12:      {

  13:          lblShowStuff.Text = DateTime.Now.ToLongTimeString();

  14:          mdePopup.Show();

  15:      }

  16:  }


...read more!

Wednesday, February 28, 2007

March CTP for Orcas (Visual Studio)

Good news: March CTP for Orcas is out.

It's unfortunate that I have not had time to keep up with Orcas as of yet. Just recently I downloaded the last CTP for Orcas, but haven't cracked it open yet. Now I get to download this new version and trash the older one....read more!

Monday, February 26, 2007

Hi-def Vista wallpapers

Just a reminder for myself...

Hi-def Vista wallpapers: http://www.hamaddarwish.com/content/index.html

...read more!

FlipCalc

A couple of friends of mine are working on this really great site. The idea is a calculator that gives you an idea of the investment and return on trying to flip a house. The great thing about this site is that it uses real data on a house (given the address) and the expenses and investments.

I really do think that FlipCalc is a novel idea, and also proves that with the right idea and some invested time, you can get a small business off the ground. Where FlipCalc will go from here, I dont know, but I can really see some great extensions and partnerships taking off from here.

You can find it here: FlipCalc....read more!

Short blogging siesta

I had to take a little siesta on this blog as I re-evaluated my stance on starting this business at this point in my life. I have recently moved and gotten a new full time job, and I didn't know whether I would be able to continue my endeavours with my new business. As such, I decided to move forward with my start-up so that I can have some of my ideas perculate while I find ways to make them grow.

I'll resume writing as I make progress on filing my paperwork with business....read more!