As of the 1st of October 2006 it is no longer possible to apply for work and residence permit while being in Norway on a tourist visa.
Everyone that gets married in Norway on a tourist visa must return to their home country to apply for family reunification. This is in accordance with the statement from the Ministry of Labour and Social Inclusion of 15 September 2006 (In Norwegian only).
At the end of the statement there is a link to the Immigration Regulations where you can find more information on this.