Use a webform page to handle an ajax post.

Today I needed to make an ajax call in an older webform site. Something easy for mvc or maybe webapi but that’s overkill. I decided to make a web form to do the work. First I need to tap in to the event. When I make the call from javascript using $.ajax() I can handle the request by putting this in page_load. Note they are separate pages in my solution..   if (!IsPostBack && Request.HttpMethod...

June 13th, 2014 by B.Harding 

Excel macro insert row below the current cell

This is a tweak that saves me some time. Sub InsertRowBelow() ' ' InsertRow Macro ' ' Keyboard Shortcut: Ctrl+Shift+I ' Dim rw rw = Selection.Row 'get the original row col = Selection.Column 'get the original column Rows(rw + 1 & ":" & rw + 1 ).Select 'select the row below Selection.Insert...

October 31st, 2012 by B.Harding 

Server Side Include messed up my layout

Here is what happened: I migrated some content to an SSI and when I viewed the page it was different. The file was SHTML. I had a div that was supposed to hug the top of the page. After, it was moved to SSI, it was pushed down 1 line. Tools Used: Fiddler Notepad ++ The cause: Shtml SSI streams the bytes of the included file byte for byte. The included file was saved as UTF-8 With BOM.  The BOM bytes...

January 9th, 2012 by B.Harding 

Log4Net in a Windows Forms app (quick and easy)

This post will show you how get Log4Net working ASAP on a windows forms application. First, get Log4net. The easiest way to do this is to open the Tools, Library Package Manager, Package Manager Console then type Install-Package Log4Net Next add the log4net config to your App.config. WATCH OUT!   <configSections> must be the first child element of <configuration> WATCH OUT!  Target the...

August 10th, 2011 by B.Harding 

How to read a POST’s raw data

I was tasked with accepting data posted from an AS400 to a web page. The only problem is that for some reason the Request.Form was empty. I’m not sure if this violates the RFC or not but I have to deal with it. Luckily I can adapt with a few short lines. It turns out that this is caused by not using the correct content-type when the request was made. The request.form isn’t parsed unless...

April 13th, 2011 by B.Harding 

Garage Door Opener Stripped Gear-How do you remove a Roll Pin?

Q: How do you remove a Roll Pin? A: With a Craftsman Roll Punch from Sears After about 10 years my garage door quit working. After a couple of turns of the screw driver I see that the innerds are full of gear dust. My drive gear is stripped! To fix or replace? That is the question. I quickly discover that a new gear is only $12 on ebay and that includes grease and free shipping. Done. When it arrives...

February 18th, 2010 by B.Harding 

Watch out Chuck Norris! Scott Guthrie is in town!

Boosted from http://developerdeveloperdeveloper.com/guathon/Default.aspx Some things you might not know about Scott Guthrie When Scott Guthrie throws exceptions, it’s across the room. All arrays Scott Guthrie declares are of infinite size, because Scott Guthrie knows no bounds. Scott Guthrie doesn’t have disk latency because the hard drive knows to hurry up. Scott Guthrie writes code that optimizes...

September 24th, 2009 by B.Harding 

My job hunt brain-dump

A couple of weeks ago I began working as a Web Developer for the American Motorcyclist Association. To me this is a big deal because I have the actual title of “Web Developer”. I love it. It’s a dream job. Nice people, nice gear, nice facilities and they have an adequate budget, I get benefits and paid over time. WooHoo! Getting here has been a bit of a journey. I’ve just come...

September 7th, 2009 by B.Harding 

switch to ssl automatically

In this post I’ll explain how I transparently switch from http to https This same snipit can be put on any page as is and forces certain pages to be https. The nice thing about it is that the user can not edit the url back to http on a page that has this. All I did was put it on the login page and payment page. On page load the server examines the Request.IsSecureConnection flag and redirects...

February 5th, 2009 by B.Harding 

Use Css to center a div

Using tables to layout a page is considered outdated. The “new” way to do it is with Div tags a alot of Cascading Style Sheets. To center a table is easy. You just set align=”center”. But what about when using the new way? When you want to center a div in the middle of the page use either a style or a css class to set the following attibutes: width: a fixed width; margin-right:auto; margin-left:auto; Note...

February 5th, 2009 by B.Harding