Sunday, October 26, 2008

Dev and Dev, maybe some more Dev...



Haven't been around for a few days, been kind of  in hibernation getting some things done. Got the first few pages out and tested and about to have a few more. After Nov 1st and before Dec 1st my goals are the following:


-Implement the payment gateway (between the pages and the security)


-Get the forums up and going, I think I'm going to be using  Community Server.


-Complete user logic


-Url Rewriting


-Ad rotation


-S3 Image upload from the browser (fileserver to S3) ... having trouble finding .NET support for this


-Choosing a production server, I'm leaning towards Rackspace?


I guess the point is it wont be a lot of development. Which is a bummer but it means I will be done by then (hurrah!!)


For those of us NOT at PDC, some MVP's and ASPInsiders are putting together a group #NotatPDC. For information on giving a talk or how to partcipate here is the email associated.


I DID catch up on a lot of TV over the weekend. SNL was pretty good last night, however, there was a lot of Mad Men references. I'm a little paranoid now that I've been warned that Mad Men is due to jump the shark soon because of it's publicity. The Mad Men finale was good, as you can imagine I love me some Peggy, but come on, she deserves better than that, no. (look ma, no spoiler!) Dexter is becoming less relatable. I feel like he is letting his guard down in an unrealistic manner.


Does anyone watch the show Life? There were two great shows that NBC came out with last year. One was Journey Man and the other was Life. Journey Man was awesome, and it was SUCH a bummer it got canned (why do I feel like I've talked about this before) but Life is still on Friday nights. It's a cop drama, but it has a better underlying plot then most, I feel. The lead character was wrongfully imprisoned for years and then given his job back as a cop after he got out. He spends his life finding Zen for himself and trying to find "the real killers." I really admire people like this in real life who go through something terrible and are determined to face life with passion and not feel sorry for themselves, like this guy.


Oh, and of course every self-respecting nerd has to like Fringe. There is a Mulder shaped hole in my heart and I'm trying to let Fringe fill it. It's hard, but I'm sure it's like riding a bike.



How To: Use Dynamic Images in the ASP.NET SiteMapPath control









ASP.NET offers all kinds of controls for all of your development needs. I'm convinced that in 5 years there will be one control <asp:YourWebsite runat=”server”/> However, until that part there is still use for us programmers. Recently, I had use to use a new one and I thought I'd share my experience.



So, the SiteMapPath control is very convenient when you are adding breadcrumbs to your web application. However, if you want to make your breadcrumbs a little more dynamic then they are packaged, you will need to do it pro grammatically, I will share my process below. 


Ok, so step one: Creating your site map. Your control needs a datasource , and you have to add that in the form of an asp SiteMap. It's basically an xml page the guts of which look a little like this:


<siteMapNode url="Default,aspx" title="Home" >


<siteMapNode url="DoSomeJunk.aspx" title="Here's Where Users Do Junk" >


<siteMapNode url="AboutUs.aspx" title="About Us" />


</siteMapNode>




 


The outer node is the parent for the others, and that is how you indicate it in the site map. Ok, now creating your SiteMapPath control, your default datasource will be the web.sitemap, if you want it to point to a different site map you can set the SiteMapProvider property.




 


Your default SiteMapPath ends up coming out like this:




 




 


<asp:SiteMapPath ID="siteMapPath" runat="server">


</asp:SiteMapPath>




 


Now, you can leave it like that and it will look like this when you are on the About Us page:




 


Home > About Us




 


However, some of us like adding some snazz to our apps. My designer gave me breadcrumbs that look like kind of like this:


  HOME LOCAL SEARCH




 


Now, the SiteMapPath allows you to add images inbetween your links by populating the SMP (SiteMapPath)'s “PathSeparatorTemplate” property. There are a few templates in the SMP, the others are “CurrentSeperatorTemplate” which is the node that represents the page you are on, the “ParentSeperatorTemplate” which is the parent node (obv), and the “RootSeperatorTemplate (you get the drift). You can put an image in the PathSeperatorTemplate, or some words, a picture of your kids... whatever you want, and it will go between each one of your nodes like so:







However, since I had different pictures inbetween each of my nodes I needed to dynamically load the images in runtime after testing which nodes were displayed and where. Upon learning that the SMP had a ItemDataBound event I was able to load I t like a repeater (a control I use a little more often.) There are two ways to do this, I used an if statement,but it got a little long... It looks like this:




 


 


protected void siteMapPath_ItemDataBound(object sender, SiteMapNodeItemEventArgs e)


{


 


      var node = e.Item.SiteMapNode;


      if (e.Item.ItemType == SiteMapNodeItemType.PathSeperator)|


     {



          if (node.Url == "/Default.aspx")


         {


               ((Image) e.Item.FindControl("imgNode")).ImageUrl = "~/Images/blue-dot-small.gif";


         }


        if (node.Url == "/Classifieds.aspx")


        {


          ((Image) e.Item.FindControl("imgNode")).ImageUrl = "~/Images/green-dot-small.gif";


        }


 


        if (node.Url == "/ViewCalendar.aspx")


        {


             ((Image) e.Item.FindControl("imgNode")).ImageUrl = "~/Images/grey-dot-small.gif";


       }


}


}




 


So I graduated to naming my images after my pages and did this:




 


protected void siteMapPath_ItemDataBound(object sender, SiteMapNodeItemEventArgs e)


{


      var node = e.Item.SiteMapNode;


      if (e.Item.ItemType == SiteMapNodeItemType.PathSeperator)


      {


           ((Image) e.Item.FindControl("imgNode")).ImageUrl = "~/Images/" + node.Title + “_Breadcrumb.gif”;


     }


}


 


 


Skip Navigation Links


And that, I decided, was the best way, for now. So that's how you add dynamic images to your asp.net SiteMapPath control! Thanks for reading, and as usual:


 




Tuesday, October 21, 2008

An Anthem



I have an iPhone, I like the band Cake, I drink octane drinks, the whole world spins and I'm hunched over a 17" screen for 12 hours straight.


I'm a Developer.


I like math, I have a wall sized white board, I crack my knuckles, I don't do suits


I'm a Developer.


I'm the internet's engine, I am a Data Architect, I will break it without buying, I worship source control


I am a Developer 


I think I like Fringe, I might buy a Hybrid, I pirate music, I love War Games


I'm a Developer


My dishes have mold, I hope I fed my cat, My hair is greasy, I may sleep at work


I'm a Developer a week before release.

 



Wednesday, October 15, 2008

Reflection - Iteration 8 of 9

razor slide 


WHOOOOOOOOOOOOOOO!!!!!


Honestly, I kid. I know I've been doing a lot of complaining lately ... and in my defense I have been pretty stressed. This is a huge responsibility, and I take it very seriously. I'm enamored by the idea behind the site. I'm in love with the design. I seriously can't wait to forward the link around to everyone and get their reaction. I have been given many resources and freedoms as far as the development process, and that means so much to me. All in all I can't wait to step back and say "F-yeah, I did that." That being said, and I'm sure that many of you have been at this point in your development careers.



As I've discussed I'm a n00b. I started out with a SQL focus about 6 years ago. Dabbled a bit in VB. I have been doing ASP.NET/C# for about 2.5 years now. So, developing an application of this magnitude has been a rocky, rocky road. I've had a lot of support, but even now during crunch time, I'm exhausted. In a good way? I imagine this is how you feel when giving birth (if even one guy emails me that giving birth "is not that hard" I'm flipping the heck out. Men always say this and should never EVER no matter what your wife tells  you.) I imagine this is like that part where it is most painful and almost over. I have one page left to develop. It's a doozy. I have some loose ends to tie up on 3 others. November 1st is my Alpha deadline. Then December 1st for Beta.



Tonight I am getting a decent night's sleep. I left earlier than usual. However, lately not so much. Again, I'm not complaining! This will all be worth it in the end, such an accomplishment for myself. I'm so excited.



Any words of support or advice from people who have been here are much appreciated. Any words of "HOLY CRAP YOU STILL HAVE A WHOLE PAGE" will be greated with sobs.



What am I struggling with? Well, how to load my images and store them related to certain records (using LINQ for objects thus far). Allowing users to upload video. I'm using s3, but I have to build an interface (along with consultant) for uploads. I have found a consultant to do the import from File Maker Pro who is versed in SQL Server 2005 and FMP which is hard to find, however, I worry about how he will do and his speed. I'm worried that I wont get the last page done in time. I worry that I'll never end this post and get some sleep...lol... so, if you want to know what I will be dreaming of you got it.



Anyway, good night, all.


Sara




 



Sunday, October 12, 2008

Philly .NET Code(nerd) Camp


So, this Saturday I went to my first Code Camp. It was cool to know there were that many nerds(myself included) in the area (kind of my area). I could have done without all the Phillies gear (go Dodgers! or Rays! or Boston!). I learned a whole bunch. My personal favorite talk was about REST programming with Sam Gentile. I thought his talk was entertaining and informative. Great learn.


Two cool things happened, I was approached by a Microsoft Evangelist about their budding woman developer program. She explained that they are researching the desire for one.Apparently there are two schools of thought

"I'm a woman developer, therefore I am unique" and "I'm a woman developer, don't single me out." I guess we all know what school I am in,lol. I am quite proud of being a female developer. Not because it has been "hard" or I've been "discriminated against." Because I honestly believe being a female in this industry has been more of an advantage than a handicap. I just think it's different. I think there are things that are unique about us and I'd love to discuss it. Also, I'd love to learn what environment other women grew up in. That way we can learn how to make more of us!


I was also approached by a woman who wants to start a women's user group in NJ which is hardcore. It's funny because I have many male developer friends, and I love them, but there are some things I can't talk to them about. Even just last week after I had pulled an all nighter working I found myself wishing I had a woman to talk to about it. You know? It's just different. It's not sexist, I don't believe that sexism is recognizing the difference in the sexes. I think that the differences and overcoming some of them, is what makes today's woman awesome.


Anyway, all in all, good experience. Will write a longer review this week. I feel guilty because I got NO work done today and I had intended on doing a bunch.



Wednesday, October 1, 2008

New Article Published

Feel free to comment here as it takes a while to get feedback from the site. :)



Clicky Clicky