sharepointking

Just another WordPress.com site

Monthly Archives: December 2008

Fold/Unfold Field on Sharepoint List View : Custom ViewStyle – Sharepoint

To Unfold message click on “Show”. Refer below screenshot:

To fold Message click on “Hide”. Refer below screenshot

First of read article (http://msdn.microsoft.com/en-us/library/ms916812.aspx) how to adde ViewStyle into sharepoint at .xml file and then create new viewstyle block

and add below block

Sharepoint & SSL – Programatically validate SSL in your code

My experience:

I have developed one webpart and it was working fine on my development server with http:// protocol but when i deployed that webpart on production server where SSL was configured on website. After deployment of webpart production server started giving error e.g. Access denied even if user has FULLControl or Owner or Administrator

I have just created below class and call call it from my webpart constructor

/====================================================================
// trustedCertificatePolicy.cs
//====================================================================
using System;
using System.Net;
using System.Security;
using System.Security.Cryptography.X509Certificates;

namespace myApp
{
public class trustedCertificatePolicy : System.Net.ICertificatePolicy
{
public trustedCertificatePolicy() {}

public bool CheckValidationResult
(
System.Net.ServicePoint sp,
System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Net.WebRequest request, int problem)
{
return true;
}
}
}

Validate SSL Certificate from your webpart code mention below:

….
//construcor of my class
public LoginToolPart()
{
this.ID = “LoginToolPart”;
// call method from above implemented trustedCertificatePolicy class
System.Net.ServicePointManager.CertificatePolicy = new trustedCertificatePolicy();
}

Hope this will solve your problem

Cheer!!!