maandag 30 november 2009

Wortell Blog

The company I work for Wortell, has a new company blog. This blog will be written by many of my colleagues and can be found at this URL: http://blog.wortell.nl. It will contain blog posts about SharePoint 2010, OCS, Programming, and many more subjects.

Enjoy!

donderdag 26 november 2009

Hide the root node of an ASP.NET Treeview control

When using a XmlDataSource object as the datasource of your treeview control, it can be a challenge to hide the root node of the review. (it was for me… )

I found (on this blog)that the XmlDataSource class has a property called Xpath. Assign this property the value of “/*/*” and your root node will be hidden. Pretty easy, isn’t it…

donderdag 12 november 2009

SharePoint – JavaScript OnLoad

Today I needed to fire some JavaScript code when a SharePoint page loaded. There are several ways to do this as far as I can tell, but there is only one way which I liked. After your JavaScript code you should include the following code:

_spBodyOnLoadFunctionNames.push("your method");

My customer needed a (pop-up) page that was printed and closed immediately after it was opened. I did this in the following way:

StringBuilder script = new StringBuilder();
script.Append("function onLoad()");
script.Append("{");
script.Append("  window.print();");
script.Append("  window.close();");
script.Append("}");
script.Append("_spBodyOnLoadFunctionNames.push(\"onLoad\")");

You should of course not forget to register your JavaScript. :-)