Assemblies in the GAC are given FullTrust. This is a problem with running code in the GAC; anyone, trusted or not, can call your code. Pulling the assemblies out of the GAC and placing them in the BIN directory changed the manner in which they were being called. Here is what needs to be done.

  • Open the AssembleInfo.cs file for your shared assembly.
  • Make sure you have included the 'using System.Security' reference.
  • Anywhere in that file add the [assembly:AllowPartiallyTrustedCallers] assembly attribute. For more information on this assembly attribute, see MSDN : AllowPartiallyTrustedCallersAttribute Class.
  • Recompile, deploy the assemblie(s) and reset IIS.


How to programmatically create a ghosted web part page

Using SPWeb.ProcessBatchData will allow you to create a ghosted page…

        using (SPSite site = new SPSite ("http://server/")) {

          using (SPWeb web = site.OpenWeb()) {

           

            SPList list = web.Lists ["Shared Documents"];

           

            string postInformation =

              "" +     

              "" +

                "" + list.ID + "" +

                "New" +

                "NewWebPage" +

                "WebPartPage" +

                "2" +

                "MyWebPartPageName" +

                "true" +

              "";

             

            string processBatch = web.ProcessBatchData(postInformation);

           

            // Display the results...

            Console.WriteLine(processBatch);

            Console.ReadLine ();

           

          }

        }

The yellow highlights are the variables that represent options on the New Web Part Page.


From Mark Kruger's Blog

Access the Portal Web Part Gallery Permissions via URL Hack

How to get to the Portal Web Part Gallery Permissions

You can navigate to your Web Part Gallery via: http://yourportalurl/_catalogs/wp/forms/allitems.aspx


From http://forum.olympiacos.org/blogs/venceremos/archive/2005/10/22/dimitrisv.aspx

Guide to Reinstall - Migrate SPS 2003 to SQL 2005 (September Community Technology Preview) aka "fancy doubling/trebling the speed of your SPS installation?" Rated Excellent [5 out of 5].

Just succeeded in setting up Sharepoint Portal Server 2003 to run on SQL 2005 September CTP and I thought, due to the huge improvement in performance (2-3 times faster depending on the task), that it may be useful to many so I decided to share the process with you here. 

The task was to use the same kit of hardware and have SPS and SQL2005 on the same machine (clean install). 

Here is how it is done:

0. Because I dont want moaning and groaning for broken promises go and get yourself Microsoft ® Windows Server ™ 2003 Performance Advisor and measure your existing systems performance.
1. You run the BackUp and Restore Utility of SPS in order to back up your site and you save it in another server.
2. Remove the server from the domain.
3. Setup your Windows 2003 Server (preferably with SP1 included). If you have a six disk server go for: 2XRAID 1 (system), 3XRAID5  (data), 1XRAID0 (tempdb, SPS indexes).
4. Do join the domain during setup - long gone are the issues of not finding the domain etc (assuming that your DC is also W2k3 SP1)
(4a. Follow the steps of your Hardware Manufacturer -HP  in my case  (i.e. the post installation steps of SmartStart 7.40) - and reboot)
5. Apply all the post SP1 patches (18 to date).
6. Add the role of application server to the server through the wizard - enabling ASP.NET but NOT the FrontPage extensions.
7. Make sure that you do not alter (for the time being) the default locale from English and you add other services that you may like i.e. SMTP etc. and do work such as setting the page file, process priority, formating your SQL data partition to disk allocation size of 64k (it really does improve performance!) and you reboot.
8. Set up your SQL 2005 Enterprise by selecting all default options - apart from the location of your data files (to that partition that you formated with that 64k allocation size which is the optimum) and following the completion of the setup you reboot (just to ensure that everything is up and running).  It is worthwhile not to use SQL security - Just leave it to windows authentication and start the service to a local user account that you create in your system (SQL -depending on your logging- can be quite demanding on the AD if you use a domain account). Now alter the localle to that of your previews installation. Bear in mind that there are installation issues of the reporting services with non-english default localles so this is why I told you in step 7 of not altering your locale prior to SQL installation. It will spoil the RS installation.   
And here is the juicy part:
9.  Download WSS WITH SP2 from here: http://www.microsoft.com/downloads/details.aspx?FamilyId=B922B28D-806A-427B-A4C5-AB0F1AA0F7F9&displaylang=en  and install by selecting option two (member of a Server farm - do not install MSDE). In the web page based configurration wizzard that will start you just stop after the set up of the first page. i.e. the page that you select the application pool identity and the authentication type which MUST be KERBEROS .
10. Press next, cmd iisreset and OK. You have now finished with your WSS set up as far as its coexistance with SPS 2003 is concerned.
11. Go to your SQL 2005 and give full permissions to the user that is running the application pool you created before. This is the user that will be used to create and later to modify the config database.
12. Insert your WPS 2003 CD. It detects that you have WSS it will give you a warning about the unlinking of your existing sites (which you duly ignore) and then goes ahead with the installation of the core engine.
13. Needless to say that you wont choose MSDE installation and that you will point your installation to your SQL 2005 instance, that you will choose another partition for the Data and that you will use the user you created before in order to create the SPS_config Database (use the same user to be sure that you have the password right ;) and that he has permissions to even be databasecreator.
14. The installation will finish and will present you with the first pages of set up of the portal. Go ahead to select the user that will run the application (the one you made earlier), define the email settings and choose the topology (i.e. index, site, search all in the same box).
15. Very crucial point here: You close your IE window right here and you apply the SPS 2003 SP2 which you can find here http://www.microsoft.com/downloads/details.aspx?FamilyId=171DC9A7-B4BA-4759-BD64-6B7D851A97EF&displaylang=en  You are almost done.
16. Create in your IIS the site where your sharepoint site will sit (in case you dont use the default - as many paranoid people like myself avoid using from the times of IIS 5 and earlier) and your provide the appropriate host header.
17. Move your backup data from the server that you saved them (before the format of the original machine) to the partition that wont host your actuall server data (i.e. you copy it to C if on D is where your data will actually be placed - it is very important this as it will save you quite a few minutes).
18. Now you run the SPS Back Up and Restore tool and you restore your databases and the site setting to the very final detail (users, user sites everything gets migrated). Attention though here. If you have huge databases (in my case the site database was tens of Gigs) the restore of the database can take hours. In the first half an hour you may see the progress bar stuck in 0. You will also see that the SQL Data Folder the site database has claimed the space but it doesnot increases further but... you have to wait. Dont ruin here guys - watch it. You just wait and your take comfort from the fact that the hard disks are working like mad. Finally add rights to the databases that were just restored to the user in your new server. 
19. After that you are... DONE! The database will reindex for a few more minutes (dont get nuts with the CPU in the 80s-100) and then you enjoy!
You enjoy integration with reporting services of SQL 2005, you enjoy speed that lightening comperated to the SQL 2000 - well worth the effort..
20. Run the performance advisor to validate your eyes (because you just wont believe your eyes with the improvement[;)]), make a tea and then move your SQL temp.db to another partition (either the RAID o or the systems but definately NOT in the same physical media as your data).

That was my trouble-free experience. It may not be yours however. For that reason in order to be save you take backup of your 3 databases and also you detach them before you do the formating of your previous system and then migrate using the manual process (attach/restore to SQL and by specifing the database in the Portal Data Configuration Page). 

Dimitris Vayenas, MIEE.

PS. If you deploy your Portal to the internet or to wireless users (with RADIUS-SSL) you may find this link extremely useful. I wrote it because during my off line demos had diffuculties in getting my SSL issued from my CA/IAS server. It also include the links to two of the most useful deployment articles you may see at Technet for all those interested in giving really secure Wireless Acceess in your company.
PS2. Yes the installation is in a production environment and the server runs so fast that is worthwhile browsing/using from the internet. Sorry for not including the reports. Silly me I forgot to save the initial reports. If someone need the new ones please write a comment and will post them.
PS3. In the new system I also used two fixed paging spaces of 4096 MB in the system and data disks.   


From http://forum.olympiacos.org/blogs/venceremos/archive/2005/10/23/43909.aspx

Securing your SPS 2003 Portal

It is quite common that you may want to give external access to your SPS portal.

It is also quite common that you provide a RADIUS controlled access to mobile devices in your organization.

Assuming that you have used either of the techniques recommended by Microsoft Best Practices you may find yourself in trouble when requesting off line the issue of the certificate by your Certificate/Internet Authentication Service Server.

You are most likely to get in your CA Server the following error: Certificate not issued (Denied) Denied by Policy Module 0x80094801 error.

(If your CA is on line the installation goes well)

To solve the issue you have to manually do the request by issuing the command:

certreq -attrib "CertificateTemplate:WebServer" -submit certreq.txt

PS: The Best practices are here:
1. Securing Wireless LANs with PEAP and Passwords : The textual guide can  be found in HTML here
2. Securing Wireless LANs with Certificate Services: The textual guide can be found in HTML  here

If however you use a stand alone machine (like in SBS) you can create your certificate using the SelfSSL util in Internet Information Services (IIS) 6.0 Resource Kit Tools: this way you dont need a certificate server.


 

To enable created web part pages to be saved into document libraries, update the following file:
Common files\Microsoft Shared\Web Server Extensions\60\Template\Layouts\1033\spcf.aspx

Down around line 300, there is some Javascript that controls what document library types are available in the drop down list of save locations.

Here is the original condition in the code:
if ((!spList.Hidden) && (spList.BaseType == SPBaseType.DocumentLibrary) && (spList.BaseTemplate == SPListTemplateType.DocumentLibrary))

I modified the condition to also include the TemplateID for my custom document library (200):
if ( ((!spList.Hidden) && ((spList.BaseType == SPBaseType.DocumentLibrary) ((int)spList.BaseType == 200))) && ((spList.BaseTemplate == SPListTemplateType.DocumentLibrary) ((int)spList.BaseTemplate == 200)) )


 From Dustin Miller's Blog

Automatically calculate Full Name when adding contacts / editing contacts First Name or Last Name.

At the bottom of the NewForm.aspx and EditForm.aspx for any default Contacts list, just above the closing </body> element, add this code:

 <script>
  var lastName = document.getElementById("urn:schemas-microsoft-com:office:office#Title")
  var firstName = document.getElementById("urn:schemas-microsoft-com:office:office#FirstName");
  var fullName = document.getElementById("urn:schemas-microsoft-com:office:office#FullName");
  lastName.onchange = fixFullName;
  firstName.onchange = fixFullName;
  
  function fixFullName() {
   fullName.value = firstName.value + " " + lastName.value;
  }
  
 </script>
 


Portal Design example