Nisses blog

Slå mig, älska mig

Archive for December, 2009

Solution for error: BlogEngine is not defined

I’ve upgraded my blog to BlogEngine 1.5.0.7 and then I got a Java Error saing BlogEngine is not defined. The solution is the following.

Download the latest version from codeplex.
Extract blog.js and open it in your favorite editor and look at the code.

// global object
BlogEngine = {
    $: function(id) {
        return document.getElementById(id);
    }

 

The first row is to be deleted, so the start of the file will look like this.

BlogEngine = {
    $: function(id) {
        return document.getElementById(id);
    }

 

Upload the file and restart your .NET application. Edit your Web.Config to get the server to recompile the site.

Technorati-taggar: ,
posted by Nisse in Code,Technical and have No Comments

32-bit ODBC in Windows 2008 64-bit Enviroment

I’m installing a new database server and the application is using the 32bit ODBC-connections and the server is a 64-bit SQL. To configure 32-bit ODBC connections hit run and paste the following command.

%windir%\SysWOW64\odbcad32.exe
posted by Nisse in Technical and have No Comments

Howto implement google maps and a marker

I’m developing a site for a customer who wish to have  a map of his stores and a marker as well. Googles new v3 API of google map is what i’m using since it’s newer and hade a nice look and feel than v2.

In my application i’m reading the coordinates from a database but for this example we will use static. Paste the following code in your <HEAD> secion.

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
 <script type="text/javascript">
  function initialize() {
    var myLatlng = new google.maps.LatLng(<? echo $clsShop->LatLong;?>);
    var myOptions = {
      zoom: 13,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    var marker = new google.maps.Marker({
        position: myLatlng,
        map: map,
        title:"Hello World!"
    });
  }

</script>

In your <BODY> tag we will load the map with the onLoad command and unload it when we leave. Use the following tag.

<body onload="initialize()" onunload="GUnload()">

 

Then all you need to do is to create a <div> with id = map_canvas where you wish to place the map. You can use the following example.

<div id="map_canvas" style="width: 220px; height: 220px"></div>

 

Then you’re all set and google maps will load. If not you might need sign up for the google API. For more examples you can check out googles own example gallery

posted by Nisse in Code and have No Comments

Force removal of Visual Studio 2008

I’ve canceled my installation of Visual Studio 2008 and when I now try to install it again I get an error and can’t continue. Can’t unistall either so I found a tool supplied by Microsoft. It will remove all the components so that I can run the installation again.

Microsoft Visual Studio 2008 RC/RTM uninstall tool

posted by Nisse in Technical and have No Comments