Geeks With Blogs!

This historical series of posts were recovered from a site that has been removed from the Internet, thanks to the Wayback Machine.

Table of Contents

Ramona Eid

I Kick Butt And Take No Prisoners

Celebrating a year at Bomanite this week by installing both Apache Web Server (Open Source designed for Unix and Linux) and the Web Server called IIS (Microsoft Internet Information Server designed for Windows) on both Windows 10 and Windows 7 (yes, I have a computer that cannot be upgraded). This means I can choose whichever Web Server I want. I can continue to develop WordPress Plugins and Themes using Visual Studio or do it the “MAC” way, which seems to be the only way everyone else knows how to do it.

For those of you for whom GEEK is a second language, let me explain what that means.
That means: I am PHENOMENAL!
That means: I Kick Butt and Take No Prisoners.
That means: I FORCE disparate entities to work harmoniously together and play NICE IN THE SANDBOX, whether they want to or not … and they don’t even realize they are doing it. I have previously done it with Azure Blobs (Microsoft Cloud), AWS S3 (Amazon Cloud), Google Docs (Google Cloud), and Google AdWords.

Why wasn’t it ME selected as the First Woman Presidential Candidate? Talk about a CHANGE AGENT who ALWAYS thinks so far outside the box, that I turn the box into a CIRCLE instead. A circle where EVERYONE/EVERYTHING gets included! All I am after is RESULTS. I just want to get the JOB DONE.
Just saying …

Posted On Monday, August 1, 2016 10:02 PM 

Google Website Call Tracking undocumented debugger

I am tasked with implementing Google Website Call Tracking.  After writing code in an Unobtrusive JavaScript Library, I realized the Team did not have a live toll-free phone number with which to test my code.

Knowing how I would have written the call tracking library, I guessed that there was probably some way to debug or test code in this scenario.  I carefully read through the minified code, utilizing the Chrome Developer Tools and the Pretty Print functionality.  I even set a few break points to confirm what I felt was a way to trigger a debugger.

So what is the [workaround]?

The secret is to append #goog-wcm-debug to the Query String of the URL and reload the window.  That will load a hidden DIV into the DOM.  It’s hidden because the style is set to display: none.  There are also two buttons: Retry and Force.  I knew that the Force button was the one I needed.  See the screen shot below:

To unhide the DIV and the buttons is a simple matter of changing the style in the Styles Tab.  See the screen-shot below:

When you click on the Force Button it returns a default test number from the Google library.  You are then able to verify if your code works and actually replaces the numbers you want.

And voila!  Problem solved!

Posted On Monday, January 5, 2015 1:04 PM 

jQuery.ajax() dataType: JSONP–Error Handler Not Called

I am tasked with using an external Web Service API from a different domain to return a JSON object using the dataType: JSONP.  

I am forced to use JSONP because it is a Cross Domain Request, and I am using an Unobtrusive JavaScript Library we host in the Azure Cloud.

Sporadically, I received an error (net::ERR_NETWORK_RESET).  There is an alternative external Web Service API from another domain that could provide similar results, but it’s reliability is potentially just as spotty.

The documentation for jQuery.ajax() specifically states in reference to the Error Handler:

Note: This handler is not called for cross-domain script and cross-domain JSONP requests.

The ajax call just fails gracefully.  That may be a behavior acceptable to you, but I needed more.

So what is the [workaround]?

The Timeout Handler is your friend!  You can specify timeout to trigger an error callback.  It means that within the specified time frame the request should be successfully completed. Otherwise, assume it has failed:

1: $.ajax({ 
2:     ... 
3:     timeout: 5000, // a lot of time for the request to be successfully completed 
4:     ... 
5:     error: function(x, t, m) { 
6:         if(t==="timeout") { 
7:             // something went wrong (handle it) 
8:         } 
9:     } 
10: });

And this is where the magic begins.    Within the Error Handler, you can use a nested jQuery.ajax() call.  Who knew?!  Yes, it was a surprise to me, too.

There are two Web Services out on the Internet that both return basically the same data.  The first one is my preferred Web Service, but is sporadically subject to network timeouts and resets. 

Here is the refactored code:

     url: '',
     dataType: 'JSONP',
     timeout: 5000,
     error: function (x, t, m) {
             url: '',
             dataType: 'JSONP',
             timeout: 2000,
             error: function (x, t, m) {
                 // Do stuff here
             .success(function (data) {
                 // Do stuff here
             });  // end of success for NESTED jQuery.ajax call
     } // end of error for OUTER jQuery.ajax call
     .success(function (data) {
                 // Do stuff here
     }); // end of success for OUTER jQuery.ajax call

And voila!  Problem solved!

Posted On Monday, March 17, 2014 4:43 PM 

Inject Pixels Into DOM

I was tasked with adding various Tracking Pixels to the DOM from an Unobtrusive JavaScript Library hosted in the Azure Cloud.

I am forced to use JSONP because it is a Cross Domain Request, and I am using an Unobtrusive JavaScript Library we host in the Azure Cloud.

It finally dawned on me that I did not have to go through the machinations of creating the pixel and appending it to the appropriate element in the DOM.

All I really needed to accomplish was to have the pixel fire (meaning: send an HTTP Request to a remote Server), complete with its Query String values, which each Server on the other side needs in order to process Server-Side-Code before returning the pixel.

It never matters whether the pixel actually appears on the page or not.  Delivering the payload is the only goal.

So what is the [workaround]?

I rethought the creation of pixels and opted for a very quick method of creating many pixels at the same time:

intermark.createImages = function () { 
    for (var i = 0; i < arguments.length; i++) { 
        var img = new Image(); 
        img.src = arguments[i].toString(); 

And then I can call the function using the following for any number of pixels necessary:

if (id > -1) { 
    intermark.createImages(pixel1Src, pixel2Src); 

And voila!  Problem solved!

Posted On Wednesday, May 9, 2012 4:00 PM 

Google Analytics Cross Domain Not Working

After setting up the Cross Domain parameters properly, using _setDomainName()_setAllowHash(), and _setAllowLinker(), and making sure to call the _trackPageview() last,  using ga_debug.js in Chrome, I was able to see that the AccountID and the SessionID were still changing upon navigating to the other Domain.

This meant the cookies were not being shared across the Domains using the _link() method from Google Analytics Asynchronous Library.

So what is the [workaround]?

After carefully studying how one would implement inline code to enable _link(), I realized I was missing a return false statement.  For inline code, the return false is used to prevent the Default Event of the anchor tag from occurring to the navigation source of the href attribute.  Using jQuery in an Unobtrusive JavaScript Library, without the return false statement, the _link() method just does not work:

$(‘a’).click(function () {
        var href = $(this).attr(‘href’);
        if (href.indexOf(OtherDomainName) >  –1)  {
             _gaq.push([‘_link’, href]);
             return false;
     return href;

And voila!  Problem solved!

Posted On Thursday, August 18, 2011 2:41 AM 

Dynamically Load jQuery From Unobtrusive JavaScript Library

I am tasked with dynamically injecting jQuery into each page if it is not already loaded from an Unobtrusive JavaScript Library.

The normal way of injecting a script tag would be:

var jq = document.createElement('script');
jq.src = '';
jq.onload = function () { initJQuery(); };
var h = document.getElementsByTagName('head')[0];

However, this will never work on IE8 or IE7, because the .onload callback is never called.

So what is the [workaround]?

//Begin Dynamically load jQuery
if (typeof jQuery == 'undefined') {
    //var jq = document.createElement('script');
    //jq.src = '';
    //jq.onload = function () { initJQuery(); };
    //var h = document.getElementsByTagName('head')[0];
        (function () {
            // more or less stolen form jquery core and adapted by paul irish
            function getScript(url, success) {
                var script = document.createElement('script');
                script.src = url;
                var head = document.getElementsByTagName('head')[0],
                    done = false;
                // Attach handlers for all browsers
                script.onload = script.onreadystatechange = function () {
                    if (!done && (!this.readyState
                         || this.readyState == 'loaded'
                         || this.readyState == 'complete')) {
                        done = true;
                        script.onload = script.onreadystatechange = null;
            getScript('', initJQuery);
else {
//End ofDynamically load jQuery

And Voila!  Problem Solved!

Posted On Thursday, April 10, 2014 1:33 AM 

Dynamically change Body Background-image!

What if you need to dynamically change the Body Background-image based on whether the Page IsPostback?  You have a CSS Stylesheet for the page, and that Stylesheet has a background-image defined for the body tag.

So what is the [workaround]?

You first must define the body tag on the page as a server control.  Then you can access the body control via code in your page:

protected void Page_Load(object sender, EventArgs e)
     if (!IsPostBack)
             var rnd = new Random();
             // the background images are incrementally named: background1,png, background2.png, etc.
             // the Random number is seeded with 1 and the maxNum is (the number of background images + 1)
             int rndInt = rnd.Next(1,4);
             string imagePath = String.Format("background-image: url('../../images/background{0}.png')", rndInt);
             // the body tag on the aspx page must be: 
             this.body1.Attributes.Add("style", imagePath);
             // this will revert back to the background image defined in the stylesheet    

And Voila!  Problem Solved!

Posted On Sunday, December 13, 2009 5:11 PM 

ReportViewer local – rdlc – handle subreports with multiple pages and parameters

using System;
 using System.Collections;
 using System.Configuration;
 using System.Data;
 using System.Linq;
 using System.Web;
 using System.Web.Security;
 using System.Web.UI;
 using System.Web.UI.HtmlControls;
 using System.Web.UI.WebControls;
 using System.Web.UI.WebControls.WebParts;
 using System.Xml.Linq;
 using Microsoft.Reporting.WebForms;
 using Rpt = SchoolDistrict.Registration.Reports;
 public partial class Reports_RegistrationReport : System.Web.UI.Page
     protected void Page_Load(object sender, EventArgs e)
         //Workaround to allow the horizontal scroll bar to show.
         ReportViewer1.Style.Add("margin-bottom", "26px");
     /// Event handler for the btnGenerateReport_Click event     /// 



     protected void btnGenerateReport_Click(object sender, EventArgs e)
         this.ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
 void LocalReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e) 
     int schoolID;
     string schoolName;
     int classID;
     string className;
     //Converts SessionKeys to appropriate values to pass to methods     GetSchoolAndClassSessionKeys(out schoolID, out schoolName, out classID, out className);
     //Determines which SubReport is being processed
     int reportPath = GetSubReportPathCase(e);
     switch (reportPath)
         case 1:
             e.DataSources.Add(new ReportDataSource("Registration", new Rpt.ReportManager().GetRegistrationRecordPctBySchool(                 schoolID, schoolName, classID, className)));
         case 2:
             e.DataSources.Add(new ReportDataSource("Registration", new Rpt.ReportManager().GetRegistrationRecordPctBySchoolDistrict(                 schoolID, schoolName, classID, className)));
         case 3:
             e.DataSources.Add(new ReportDataSource("Registration", new Rpt.ReportManager().GetRegistrationRecordComments(                 schoolID, schoolName, classID, className)));
     ////Guru's code
     //e.DataSources.Add(new ReportDataSource("Registration", new Rpt.ReportManager().GetRegistrationRecord(
     //    int.Parse(Session["SchoolNameKey"].ToString()),
     //    Session["SchoolName"] as string, int.Parse(Session["ClassNameKey"].ToString()),
     //    Session["ClassName"] as string)));
      //throw new NotImplementedException();

 /// <summary>
 /// Determines which SubReport is being processed
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 private static int GetSubReportPathCase(SubreportProcessingEventArgs e)
     //Determines which SubReport is being processed
     int reportPath = 0;
     if (e.ReportPath == "PctBySchool")
         reportPath = 1;
     else if (e.ReportPath == "PctBySchoolDistrict")
         reportPath = 2;
     else if (e.ReportPath == "Comments")
         reportPath = 3;
     return reportPath;

 /// <summary>
 /// Converts SessionKeys to appropriate values to pass to methods
 /// </summary>
 /// <param name="schoolID">passed in as 0</param>
 /// <param name="schoolName">passed in as empty string</param>
 /// <param name="classID">passed in as 0</param>
 /// <param name="className">passed in as empty string</param>
 private void GetSchoolAndClassSessionKeys(out int schoolID, out string schoolName, out int classID, out string className)
     //Converts SessionKeys to appropriate values to pass to methods
     int badValue;
     if (int.TryParse(Session["SchoolNameKey"].ToString(), out badValue))
         schoolID = int.Parse(Session["SchoolNameKey"].ToString());
         schoolID = 0;
     schoolName = Session["SchoolName"].ToString();
     if (int.TryParse(Session["ClassNameKey"].ToString(), out badValue))
         classID = int.Parse(Session["ClassNameKey"].ToString());
         classID = 0;
     className = Session["ClassName"].ToString();

 /// <summary>
 /// Method to Set or Reset the Session Keys for the School/Class based on the values in two
 /// Ajax Cascading Drop-Down Lists.
 /// </summary>
 private void SetSchoolAndClassSessionKeys()
     if (!((string.IsNullOrEmpty(ddlSchoolName.SelectedValue)) || (string.IsNullOrEmpty(ddlClassName.SelectedValue))))
         Session[ReportKeys.SchoolNameID] = ddlSchoolName.SelectedValue;
         Session[ReportKeys.SchoolName] = ddlSchoolName.SelectedItem.ToString();
         Session[ReportKeys.ClassNameID] = ddlClassName.SelectedValue;
         Session[ReportKeys.ClassName] = ddlClassName.SelectedItem.ToString();
         Session[ReportKeys.SchoolNameID] = string.Empty;
         Session[ReportKeys.SchoolName] = string.Empty;
         Session[ReportKeys.ClassNameID] = string.Empty;
         Session[ReportKeys.ClassName] = string.Empty;


 /// <summary>
 /// Event Handler for the ReportViewer1 Refresh Button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ReportViewer1_ReportRefresh(object sender, System.ComponentModel.CancelEventArgs e)
     btnGenerateReport_Click(sender, e);

And Voila!  Problem Solved!

Posted On Friday, October 9, 2009 12:46 AM 

ReportViewer local – Add a line number to the .rdlc textbox

//Add a line number to the .rdlc textbox: use this formula
//ReportViewer Conditional Formatting of BorderStyle based on whether anything is in the report.
//ReportViewer Conditional Formating and showing the Avg if there are rows in the report.
=iif(CountRows()=0,"",(Avg(Fields!PctDisb.Value) & "%"))
name: PageXofY
="Page " & Globals.PageNumber & " of " & Globals.TotalPages

Sum of PctOfTotal

And Voila!  Problem Solved!

Posted On Sunday, September 13, 2009 7:03 PM 

Implement handlers for the DataGridView control’s CellValidating and CellEndEdit events.

The CellValidating event handler is where you determine whether the value of a cell in the SchoolName column is empty. If the cell value fails validation, set the Cancel property of the System.Windows.Forms.DataGridViewCellValidatingEventArgs class to true. This causes the DataGridView control to prevent the cursor from leaving the cell. Set the ErrorText property on the row to an explanatory string. This displays an error icon with a ToolTip that contains the error text. In the CellEndEdit event handler, set the ErrorText property on the row to the empty string. The CellEndEdit event occurs only when the cell exits edit mode, which it cannot do if it fails validation.

private void dataGridView1_CellValidating(object sender,
    DataGridViewCellValidatingEventArgs e)
    // Validate the SchoolName entry by disallowing empty strings.
    if (dataGridView1.Columns[e.ColumnIndex].Name == "SchoolName")
        if (String.IsNullOrEmpty(e.FormattedValue.ToString()))
            dataGridView1.Rows[e.RowIndex].ErrorText =
                "Company Name must not be empty";
            e.Cancel = true;
void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
    // Clear the row error in case the user presses ESC.  
    dataGridView1.Rows[e.RowIndex].ErrorText = String.Empty;

And Voila!

Posted On Sunday, September 13, 2009 6:53 PM 

Entity Framework and Join Tables.

I had a true join table (two foreign keys which, together, were a composite key in the join table).  I followed the steps enumerated in Julie Lerman’s Blog Don’t Be Iffy and got unexpected behavior.  I was not only inserting new rows where they belonged, but was adding to one of the tables with the foreign key!  Not good!

Since she is the “go-to-Guru” I was baffled!  Then I realized the issue, and used Julie’s Platinum Rule to solve the problem: “The Platinum Rule is that an object graph (for example when a customer is attached to an order which is attached to some line items) must be completely in or completely outside of the ObjectContext.”

Briefly, the Use Case went something like this:  School District personnel needed to register students into different schools.  However, they needed the flexibility to pause those registrations at any time, and then to pick up where they left off.  The students would not become part of the “real” tables in the database until all of that students registration information was complete.  As a DBA, I built a “side-by-side” infrastructure, and only when the finish button was pushed would I move the paused student over to the “real” tables.

I had tables and Entity Framework entities called:

In addition, I had two join tables (for each join table: two foreign keys which, together, were a composite key in the join table).:

These two join tables don’t show up as entities, but Navigation Properties in each of the foreign key entities.  So, in other words, PausedSchool had a NavigationProperty called SpecialCircumstance, and School had a NavigationProperty called SpecialCircumstance.  Likewise, SpecialCircumstance had two NavigationProperties, one called School and one called PausedSchool.

When the finish button was clicked I should have had one new row in SchoolSpecialCircumstance that had a FK to School and a FK to SpecialCircumstance.  That row was successfully inserted.  HOWEVER, in addition, I had a new row in SpecialCircumstance with a new ID number, which was the same ID number as the FK in SchoolSpecialCircumstance.  Not acceptable!  The SpecialCircumstance were a finite list of pre-defined items, and this was in effect duplicating that data.

The issue arose because I was adding objects to the School object, which had a FK to the Student object.  At the end of this “chaining” I called AddToStudent on the ObjectContext so that all the FKs were populated correctly:


So what is the [workaround]?  The ObjectContext has to know about the FK relationships before it can do anything with them!




And Voila!  Problem solved!  Just goes to prove that “timing is everything in this world!”

Posted On Tuesday, September 8, 2009 5:02 PM

Error: conversion of a datetime2 data type to a datetime data type…

Using VS2008 and Entity Framework, the exact error message is:
“The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.\r\nThe statement has been terminated.”

There are several causes for this rather generic (and not very intuitive) error message.

I had changed some fields in the SQL 2008 database from non-nullable to nullable, and then asked the tool to “update model from database”.  The error message appeared in that instance because one part of the ADO.NET Entity Data Model does not automatically get updated when this happens.  The ADO.NET Entity Data Model has three parts:
SSDL (Store Schema Definition Language)
CSDL (Conceptual Schema Definition Language)
MSL (Mapping Schema Language)

So what is the [workaround]?

The SSDL and the MSL update just fine, but I had to “hand-code” the changes in the CSDL.

And Voila!  Problem solved!

Posted On Sunday, September 6, 2009 5:01 PM

…Session state can only be used when enableSessionState is set to true…

I am using VS2008 in a Vista Ultimate environment.  Here is the complete error message:
”Exception Details: System.Web.HttpException:  Session state can only be used when enableSessionState is set to true,
either in a configuration file or in the Page directive.  Please also make sure that System.Web.SessionStateModule or a
custom session state module is included in the “<configuration>\<system.web>\<httpModules> section in the application configuration.”

NONE of that was the problem!  I even verified that SessionState was running as a service, which it was!

Okay, what is the [workaround]?

Navigate to:
Control Panel > Programs > Turn Windows features on or off

When that dialog-box finishes loading, expand:
Internet Information Services > Web Management Tools > IIS 6.0 Management Compatibility

Make sure the following two check-boxes are checked:
IIS 6 WMI Compatibility
IIS Metabase and IIS 6 configuration compatibility

And Voila!  Problem solved!  That was a two-hour ordeal for our team!  Hope I saved you some time!

Posted On Sunday, September 6, 2009 5:00 PM

How to force update of Intellisense without opening and closing a file in Visual Studio 2008?

In Visual Studio 2008, I periodically see the error in the status bar:
”Error updating JScript Intellisense, see Error list”

HOWEVER, there are no errors about this in the Error list!  And, the site compiles, runs, and publishes perfectly!  Total annoyance!

I believe this is an error caused by the inclusion of the JQuery library and some inability of the Intellisense parser to “play nice in the playground”.

Okay, so what’s the [workaround]?

You can force an update of Intellisense with the following keyboard-shortcut:

Ctrl + Shift + J

And Voila!  Problem solved!  Annoyance gone!

Posted On Sunday, September 6, 2009 5:00 PM

Colorado Rapids Suffering from ”Mysterious White Box Syndrome”…

As you can see from the screen-shots below, the syndrome may be fatal to their Website!

Figure 1

In Figure 1, notice the prominent white-box (which is supposed to be a menu drop-down list) covering the player in the white uniform. 

Figure 2

In Figure 2, the box is wider and over to the right, covering advertising above the calendar schedule.

How in the world did the Colorado Rapids become sick with this Mysterious White Box Syndrome?  Well, I’m glad you asked!  No, really, I am!  Can’t you hear me smiling?!

The cause of this “contracted” illness is a well known issue with IE8 (Internet Explorer 8) and the dynamic menu items of the menu control.  Viewing the source, it’s obvious that the programmers used Visual Studio.  They could have easily seen this problem during the debug cycle with IE8 installed (unless they made the “less than professional” mistake of running IE8 in compatibility mode – don’t develop in that mode).  You always need to test your code for cross-browser compatibility.

The [workaround] for this problem is a simple CSS (Cascading Style Sheet) Z-Index fix:

/* this is the [workaround] for asp:menu IE8 Dynamic menu items not showing */

And Voila!  Disease cured!  I think that [workaround] is worthy of a nomination by the Nobel Committee for Medicine, don’t you?

Do you think someone should let them know?

Now, if only I had a cure for what ails them on the soccer field!!  That would be a miracle!

Posted On Wednesday, August 26, 2009 4:58 PM

Do the Colorado Rapids deserve your money….?

In this economy, I THINK NOT!

That is a very difficult conclusion for me to come to!  After all, I was the Rapids very First Webmaster for the first two years of their existence (for very little compensation) in 1995 thru 1997.  My late husband sold more Rapids tickets (without commission) than any of the original sales force.

But that was 14 long years ago!  They have never been a contender in the MLS and I see nothing happening to change that.

There seems to be an air of arrogance from the management on down to the playing field.  The players certainly have no justification for arrogance!  Quite frankly you can see better soccer at the Youth games.  In the days of the previous ownership and management, there was a sense of approachability.  Not now!

They are pressuring me to renew my Club Season Tickets (at $60 each/game).

But in this economy…I THINK NOT!

Posted On Monday, August 24, 2009 12:34 AM

Tips and Tricks – Windows Live Writer (WLW)

  1. The “normal” windows keyboard shortcuts of Ctrl+Z (undo), Ctrl+Y (redo), and Shift+Enter (new paragraph inside of bulleted/numbered items like these) work great in WLW.
  2. I had a few “Recently posted” items, from failed posts still hanging around in the right sidebar.  When I tried to click on them, I got an error message.  Very frustrating, and I wanted them gone!  If there are enough “Recently posted” items, you can just click on the More… folder link at the bottom of that section, and it opens a dialog box which gives you the option to delete them.  However, after deleting a few, I closed out of that dialog box while still having more to delete.  Suddenly, there was no More… folder link to click on!  Grrrrrr! 

The [workaround] is that you can navigate to your Documents > My Weblog Posts > Recent Posts folder.

You will find the various posts in question listed.  There is an XML file called cache.xml.  I edited the cache.xml file in notepad (after making a backup copy of it, of course), and then deleted the files in question.  Fortunately for me, they all had the same title, with a different date and time.  They were appended with, [2], [3], and [4].  I needed the last one posted (by time).  The time in the XML file corresponded, and thus I was able to delete the correct ones.  Viola!  No more nagging artifacts hanging around!

Posted On Sunday, August 23, 2009 4:57 PM

Finally decided to Blog…

I am the Geek who has resisted Blogging for so long, but now I am going  to take the plunge!

Hopefully the waters will remain calm and tranquil, no matter what topics I choose!

Posted On Saturday, August 23, 2008 10:07 PM

Leave a Comment