Archive for 'Programmieren'
Javascript onload in IE7
As pointed out in many articles, if you attach multiple events to an event in Javascript, only the last one will be executed. E.g.:
window.onload = fun1;
window.onload = fun2;
/* Reload page and only fun2 will be executed */
Unfortunately the ‘+=’ operator does not work.
The solution is attachEvent(), e.g.:
window.attachEvent("onload", fun1);
window.attachEvent("onload", fun2);
This code was only tested in IE7.
I also tried approaches like the addLoadEvent, but it did not work.
Posted: October 27th, 2008 under Programmieren.
Tags: addLoadEvent, attachEvent, IE7, Javascript, onload
Comments: none
SharePoint: How to always have the stack trace at hand
- In the web config (C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config)
- Got to the section
<system.web>
- Add the following line:
<trace enabled="true" pageOutput="true"/> - issreset
For more information: http://msdn.microsoft.com/en-us/library/ms916837.aspx#sharepoint_debugwebparts_topic5
Posted: October 21st, 2008 under Programmieren.
Tags: SharePoint 2007, stack trace, web config
Comments: none
How to install/uninstall a .wsp-File with stsadm
Install:
stsadm -o addsolution -filename path\mySolution.wsp
stsadm -o execadmsvcjobs
stsadm -o deploysolution -name mySolution.wsp -immediate -allowGacDeployment -force -allcontenturls
Uninstall:
stsadm -o retractsolution -name mySolution.wsp -immediate -allcontenturls
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name mySolution.wsp -override
stsadm -o execadmsvcjobs
Posted: October 16th, 2008 under Programmieren.
Tags: SharePoint 2007
Comments: none
SharePoint: How to get the Lcid out of the context
uint lcid = Convert.ToUInt32(Thread.CurrentThread.CurrentUICulture.LCID);
Posted: October 10th, 2008 under Programmieren.
Tags: 1033, Lcid, SharePoint
Comments: none
Get Exception Messages and Stack Trace when SharePoint/ASP.NET Error occurs
- Navigate to the site directory.
- Backup web.config.
- Open web.config.
- Switch Custom Errors off. Search for “customErrors” and set the value to “Off” instead of “On”. You can also set the value to “RemoteOnly” to troubleshoot a production issue.
- Enable CallStack. Search for “CallStack” and set the value to “true” instead of “false”.
- Save web.config.
From: http://stevepietrek.com/2007/07/28/turn-off-sharepoint-custom-error-messages/
Posted: October 3rd, 2008 under Programmieren.
Tags: ASP.NET, error handling, SharePoint
Comments: none
How to get the public key out of your key file
That doesn’t work. You have to compile the assembly with the key file and then get the public key out of the assembly.
sn -T <assemblypath>
More Info:
On the difference between the key token and the key blob
Integrate this utility into Visual Studio
Posted: September 29th, 2008 under Programmieren.
Tags: .NET, key file, public key, Visual Studio
Comments: none
How to supply your assembly with a strong name
- Generate a file containing a strong name:
sn -k Testkey.snk - Reference the file in your code:
using System.Reflection;
[assembly:AssemblyKeyFileAttribute("TestKey.snk")]
More Info: MSDN-Artikel
Posted: September 29th, 2008 under Programmieren.
Tags: .NET, C#
Comments: none
SharePoint-Bücher
Ich habe schon einige SharePoint-Bücher gesehen. Aber das einzige das bisher überzeugte war “Inside Microsoft SharePoint Services 3.0″ von Ted Pattison.
Mit dieser Kritik stimme ich überein:
Das ultimative Werk, das sich jeder WSS V3.0- und MOSS 2007 Entwickler zulegen sollte. Die Konzepte und Architektur werden anschaulich und nachvollziehbar erklärt. Auch die Tiefe passt und es wird nicht nur an der Oberfläche gekratzt. Zusätzlich sind viele nützliche Code-Beispiele anthalten (kann man herunterladen), die man für die eigenen Projekte immer wieder als Basis einsetzen kann.
ISBN-13: 978-0735623200
Posted: September 27th, 2008 under Programmieren.
Tags: Books, SharePoint, WSS
Comments: none
The security validation for this page is invalid. Click Back in your Webbrowser, refresh the page, and try your operation again.
- just another SharePoint exception
Lösung: Auf dem SharePoint-Objekt bei dem der Fehler auftritt AllowUnsafeUpdate auf true setzen. Z.B.
web.AllowUnsafeUpdates = true;
Posted: September 26th, 2008 under Programmieren.
Tags: Exception, SharePoint 2007
Comments: none
System.Collections in .NET
Ever wondered where to find a good overview of the collections available in the System.Collections workspace, their advantages and disadvanteges?
Here is a good MSDN article: http://www.microsoft.com/belux/msdn/nl/community/columns/jtielens/collections1.mspx
Posted: September 16th, 2008 under Programmieren.
Tags: System.Collections .NET
Comments: none
