Monday, June 15, 2009

SharePoint designer Hit Counter not work after installing SP2

After deploying Sp2 in our MOSS 2007 servers, suddenly the hit counter shows X image.
I have googled the issue with no luck but the interesting that I found is: the hit counter amount is stored on a file on the same directory as following:
If you attached the counter to default.aspx page then the counter file is default.aspx.cnt
When I tried to open the CNT file using SharePoint designer I got the error that the file type is blocked by the administrator.

It seems that SP2 added the CNT file type to blocked file types on central administration.

So the solution is:
1- Go to central administration web application.
2- Navigate to operation tap.
3- Under security configuration click on blocked file type.
4- Delete cnt type and then click OK.

Now the counter should work fine, have fun.

Regards,
Ahmad

Saturday, April 11, 2009

Task List Edit Assigned To field

When I tried to add task item on Sharepoint 2007 programatically I got an error mentioed that the field is maybe read only.

So....

You can not do :
item["Assigned To"] = "administrator";
item["Assigned To"] = "administrator@domain.com";
item["Assigned To"] = "domain\\administrator";


Instead, you have to specify the user ID from the user's list:

item["Assigned To"] = 1;

But how to tell what ID does a user have?
The only way I know of is using the "Users" property of the SPWeb object.
Lets say you want to assign the field to "ahmad@domain.com" (you only know the email).

you can use the following code:

item["Assigned To"] = item.ParentList.ParentWeb.Users.GetByEmail("ahmad@domain.com").ID;

Sunday, April 5, 2009

Error:Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

Problem: when I try to read xml file on the server through custom webpart on the portal ,it give below error.

“Error:Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.”

Cause: The default trust level on our test site is set to wss_minimal which does not grant us permissions to use the SharePoint Object Model from the code.

To solve this error :

There are three different ways to get over this permission problem: we can add our assembly to the GAC to run under full trust, change our web.config and set the trust level to Full, or create a custom trust level by modifying wss_minimaltrust.config with just enough trust to get our code working.
Web Part Deployment Options, the third option is the recommended approach we will take to resolve our problem.

You'll have to add these lines to the medium trust file (or a custom trust file):

<ipermission class="System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1">
< connectaccess>
< uri uri="http://myserver:myport/mysitecollection\mywebservice.asmx">
</connectaccess>
</ipermission>


The path of the trust files can be found in the web.config. In my case it was:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG

You can add multiple url's

Saturday, April 4, 2009

Create view that shows all Lists (With the same type) in the site collection

  1. Create your new Contenet type the have List type "item" name it "MyCustomContentType"
  2. create custom List Nameit "MyCustomList".
  3. Go to List setting and allow mange content type.
  4. Change the content type of "MyCustomList" to "MyCustomContentType".
  5. Save List as template.
  6. Open a Windows SharePoint Service v3 Team Site in SharePoint Designer.
  7. Insert a view on a the Announcements list with the Title, Body, and Modified fields.
  8. At the top of the Data Source Details task pane, click “MyCustomList” to open the data source properties for the current view.
  9. Click on Fields and remove all fields except ID, Title, Modified, and any of your custom link.
  10. Switch to code view, and search for DataSourceMode
  11. Change the value from List to CrossList
  12. Next search for selectcommand
  13. In the select command, type immediately after the opening quote, and leave the rest of the selectcommand as it. You should see something like this: selectcommand="<webs scope="'Recursive'"></webs><View> ...”
  14. Save the page and browse to it (F12).

Saturday, November 15, 2008

Sharepoint 2007 navigation error "page has been modified by another author"

It has been logged as a bug.

1- Go to Navigation and make a list of libraries that have been corrupted. (Look in the 'Selected Item' box at the bottom under Navigation and check the URL. Don't try save, just click Cancel.

2- Click on the document libraries in question, then Settings, Document Library or List Settings, Title Description and Navigation. Change the display on quick launch to No.

3- Open SharePoint Designer and go to the web site view. At the bottom of the website view screen, choose the Navigation option. Delete the main document libraries. Save and exit.

4- On your SharePoint site, go to View All Site Content, click on the unlinked document libraries from step 2 and relink them to the quick launch.

Wednesday, October 15, 2008

PowerPoint slide show opens as edit mode from SharePoint library

Actually and after 3 month of searching the problem I found that the coz of this problem was on registry level as below :

  1. Go to start menu and click run "regedit".

  2. Open registry and browse to HKEY_CLASSES_ROOT\PowerPoint.Show.8

  3. Double click on BrowserFlags key, and change the value to 8 (Default Value = a)
After changing the registry and if the problem does not solved do the following:

  1. Go to “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML” or 60 folder in case wss2.0 version.

  2. Open the file “DOCICON.XML” using text editor.

  3. Locate the line that start with “<mapping value="”ichtmppt.gif”……”" key="”PowerPoint.Slide”"> and change OpenControl attribute to be (OpenControl="")
  4. Locate the line that start with “<mapping value="”icpps.gif”…..”" key="”pps”"> and change OpenControl attribute to be (OpenControl="")
  5. Save and close.

  6. Open the file “htmltransinfo.xml” using text editor.

  7. Locate the line that start with “<mapping extension="”pps”…..”"> and change ProgId attribute to be (ProgId="")
  8. Save and close.

  9. Finally restart IIS and pray to me loool.

This because maybe bug on Sharepoint.opendocument class, so what I did is to remove sharepoint.open function for .pps files.


Salam