Category Archives: Uncategorized

Simple Javascript to hide/show div tag

This sample javascript will hide or show a div when user clicks the other div in browser.

<script type=”text/javascript” language=”javascript”>
    function hideElement(name) {
        if (document.getElementById(name).style.visibility == ‘hidden’) {
            document.getElementById(name).style.visibility = ‘visible’;           
            document.getElementById(name).style.visibility = ‘hidden’;

<div id=”mydiv” onclick=”hideElement(‘Div1’)” style=”background-color:Green”>test</div>
<div id=”Div1″ style=”background-color:Blue”>test2</div>


Javascript window.print() does not work in Opera/Chrome browser

You need a timout before calling print in Opera and Chrome (Netscape). Here’s the solution:

function init() {
var objBrowse = window.navigator;
if (objBrowse.appName == “Opera” || objBrowse.appName == “Netscape”) {
setTimeout(‘window.print()’, 1000);
} else {
window.onload = init;


Change application configuration in an already published ClickOnce app

For a detailed description, se this excellent article:

Quick steps

1) Remove the .deploy filextension from all files within your Application Files folder

2) Edit the .config file as requested

3) Start a Visual Studio console prompt and navigate the Application Files folder with the current version

4) Run command
mage –update Myapplication.exe.manifest

5) Re-enter the .deploy filextension to all files except the xxx.application and xxx.manifest

6) Run command
mage -update Myapplication.application -appmanifest Myapplication.exe.manifest

7) Then move back up to the folder where the publish.htm and the other .application files exist and run command
mage -update Myapplication.application -appmanifest “Application Files\Myapplication_1_2_0_13\Myapplication.exe.manifest”

8) You’re done

Errors that might occur:

System.Deployment.Application.DeploymentException (Subscription)

Unable to install this application because an application with the same identity is already installed. To install this application, either modify the manifest version for this application or uninstall the preexisting application.


Run command ”mage –cc” to clear ClickOnce cache.

IE9 “About:Tabs” – how to show more sites

With IE9 (Beta) comes a new feature in the about:tabs page wich displays favourite websites. You can increase the number of sites with a simple registry hack:

Open RegEdit and create a new DWORD value called NumRows and give it a value between 2 and 5 in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TabbedBrowsing\NewTabPage

Hopefully this will be easier with the non-beta release..

External Collaboration Toolkit

The External Collaboration Toolkit for SharePoint (Community Edition) (ECTS) is software that helps make SharePoint easier to deploy and use in an external collaboration environment. The toolkit provides the following capabilities:

* Automatically configures SharePoint for form-based authentication

* Provides a capability for typical users to create site collections (with or without administrator approval)

* Provides a capability for typical users to invite external users to their collaboration sites (with or without administrator approval)

* Provides a Site Manager that allows end users to see all their site collections

* Provides a User Manager tool that allows help desk administration of external users stored in the ADAM directory