Recruiters should not call or email me.

Wednesday, February 25, 2015 0 comments
I have changed positions over the years. It does happen. I do answer my phone and read my email. I like talking to other developers and entrepreneurs about technology. Sometimes that might involve me coding for them or with them.

I don't like it when a recruiter calls me up looking to place someone they know or wanting to fill a role they have. Please don't bother me. I won't be nice to you when you call and I'll block your email.

You can contact me on LinkedIn if you want. That is what LinkedIn is for. Calling me up at all hours of the day and night isn't going to help you, at all.

The ActionName attribute is very powerful in Sitefinity

Friday, October 3, 2014 0 comments
If you haven’t heard, Sitefinity allows for not only ASP.NET WebForms development but also ASP.NET MVC development.  http://www.sitefinity.com/mvc-cms There are different modes to MVC development in Sitefinity: Classic, Pure, and Hybrid.  I think the most common would be hybrid.  If you have an existing site and add a new MVC widget, you’re probably going to use Hybrid.

Code in Hybrid mode is a mix of WebForms in your MasterPages and Razor ASP.NET MVC in your widgets.  The routes in Hybrid mode are mixed also.  I mean to say that the routes are built for WebForms to work first and MVC second. Because of this you need to pay attention to the ActionName attribute on your control ActionResults and also your form tags.
Your controller
   1: /// <summary>
   2: /// This is the success Action.
   3: /// </summary>
   4: [ActionName("Success")]
   5: public ActionResult Success()
   6: {
   7: LoginModel model = new LoginModel();
   8: return View(model);
   9: }
  10:  
  11: [HttpPost]
  12: [ActionName("Success")]
  13: public ActionResult Success(LoginModel model)
  14: {
  15: if(ModelState.IsValid)
  16: {
  17:  
  18: }
  19: return View(model);
  20: }

Note that we use the ActionName attribute “Success”.  Normally you don’t have to do this.  The ActionName is inferred from the method name.  In Sitefinity Hybrid mode this is not the case.

Your view
   1: @model SitefinityWebApp.Mvc.Models.LoginModel
   2: <h1>
   3: @ViewData["HeaderText"]
   4: </h1>
   5: @using (Html.BeginFormSitefinity("Success", "<NAME OF WIDGET>", FormMethod.Post))
   6: {
   7:
   8: }

In your MVC view, you’ll use the helper BeginFormSitefinity.  A good convention is to use the name of the widget as the form name and we need to use the ActionName attribute “Success” in this sample to match our controller.  Here we are posting a form with inputs.

I hope this explains the power of ActionName.  It is seldom used it normal MVC development but necessary to Sitefinity MVC development.

My New Home Away From Home

Monday, January 27, 2014 0 comments

For those of my readers that have missed me, I’m going to try to write more in 2014.  So for my first post of the new year, I want to talk about what I’ve been doing the last 6 months.  I’ve been onboarding as Director of Application Development at Foundation 648, Inc. F648 is a 4 year old .NET shop here in Indiana.  It was started by Patrick Poer and Buck Brian.  After meeting them we just hit it off.  I’m still learning about all they did in the past and we are expanding our capabilities rapidly.  It’s really challenging and I’m having a heck of a great time.

 

We recently moved into some permanent space with room to grow.  The new address is 11711 N. Pennsylvania St, Suite 255, Carmel, IN 46032.  We currently have space for 5 or 6 more developers and can easily expand down the hall.  It’s a great environment and we are hiring.

 

Here are some pictures of the my new home away from home.  I have a really nice office and all the bruises have healed from moving desks.  We work hard at F648 and love to do everything ourselves. 

 

Go thru the main entrance in the rear.  There is retail in the front and office space in the back of 11711.

 

WP_20140127_014

Take the elevator upstairs

 

WP_20140127_013

 

After you get to the 2nd floor turn right

 

WP_20140127_011

 

Suite Entry

 

WP_20140127_010

 

Reception Area

 

WP_20140127_009

 

Break room

 

WP_20140127_008

 

Developer Pit

 

WP_20140127_006

 

Hallway

 

WP_20140127_004

 

President’s Office with a door to the deck

 

WP_20140127_003

 

My Office, no door but a great view

 

WP_20140127_002

dotNetConf - .NET Open Source Panel

Thursday, June 13, 2013 0 comments
I'm just catching up on some videos that I promised myself to go back and watch.  This one is cool.  Great panel included OpenRasta and ServiceStack developers among others.



Kendo UI window not centering for you?

Thursday, March 28, 2013 0 comments


I recently had to build a new site and I wanted to use Kendo UI.  It's really good stuff and there are plenty of samples.  The thing about learning from samples is that sometimes the sample is incomplete.  Like this weird thing I noticed with the code I downloaded from https://github.com/telerik/kendo-music-store.  When you click an item in the ListView it opens detail in a Kendo Window.  Pretty cool, but it's not centered.  It puts the window at the bottom of the window for some reason.


Let's look at the code (/Scripts/App/store.js).


_openWindow = function (template, viewModel) {
            // Create a placeholder element.
            var window = $(document.createElement('div'));
 
            // Apply template to the placeholder element, and bind the viewmodel.
            var templateHtml = $(template).html();
            window.html(kendo.template(templateHtml)(viewModel));
            kendo.bind(window, viewModel);
 
            // Add window placeholder to the body.
            $('body').append(window);
 
            // Turn placeholder into a Window widget.
            window.kendoWindow({
                width: config.albumDetailsWindowWidth,
                title: viewModel.data.Title,
                resizable: false,
                close: function () {
                    // When the window is closed, remove the element from the document.
                    window.parents(".k-window").remove();
                }
            });
 
            // Center and show the Window.
            window.data("kendoWindow").center();
            window.data("kendoWindow").open();
        },

First, you can chain the center and open together.  Does this fix the centering issue? No.  But it's less code.

SQL Saturday #175 Fargo, ND April 27th

Friday, March 15, 2013 0 comments
SQL Saturday #175 Fargo, ND

When I heard SQL Saturday is coming to Fargo, ND on April 27th, 2013, I could't believe it. I was onsite at a client in Fargo when the news came out.  That was a sign, I must submit a session.  Fargo is growing rapidly, heck the whole state of North Dakota is.  Fargo getting a SQL Saturday is not surprising with the oil boom and the growth of the internet and the new technology in agriculture.  North Dakota has more data than ever.  Good thing I like data.

The title of my session is "A Complete BI Solution in About an Hour!"  I really appreciate the whole Microsoft SQL stack and how you can, with one install and some quick setup, really get a problem solved in no time at all.  I'll be re-working my slide deck a bit from previous events and have new code to show.  I might even throw in some nice HTML5, CSS, and JavaScript wiz bang to end the show.

As of right now, I'm on at 10 am in room 1. SCHEDULE HERE That's a really good time for me.  My session is the only beginner level talk in that 10am slot so I hope there will be enough beginners that want to hear about BI.  If I don't fill the room, I can take more questions and show all the other ways that Microsoft makes BI easy for us SQL developers to get the job done.  

See you in April! I hear there are a lot of registrations.  I'm not surprised it's only $10 for a full day of SQL goodness.
 
 

JavaScript should be your favorite language

Thursday, March 14, 2013 0 comments
So you think you're really cool because you're hardcore and know everything there is about PHP or C# or C++ or VB or Perl or Ruby or Python or ColdFusion or Java or ActionScript or..  I should stop right?  The thing is, as developers we've been coding in all these other languages to fit the phone, desktop, server and platform we think is best.  But we were wrong.  There is no "best" or "favorite" platform.  We shouldn't have been writing Flash apps.  We shouldn't have been writing Silverlight or Windows or Mono or XNA or Java apps.  We should have been writing HTML5 apps this whole time. 

Don't get me wrong.  I don't thing that the debate of standards based apps vs native apps is over.  I think it's going to go nuclear.  Soon their will be iOS, Windows, Ubuntu, Chrome, Android, Blackberry, Firefox OS, and more to come.  They (I assume) will all probably be a little different but there will be ways to write in just HTML5, JavaScript and CSS.

So if you are really cool and prefer all those other languages, maybe you should look at JavaScript a little closer like I have this past year.  Dive deep, don't just use it when you really have to.  Try out some server side stuff like Node.js.  Or, God forbid, write a Windows Store App in JavaScript instead of C#.  You might like it.  I do.
 
Copyright © Aaron Stanley King