Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

Wednesday, February 29, 2012

Css styles not being applied for Anonymous users on sharepoint 2010

I have been stuck with the same problem and dint understand the problem for long enough....
I realized to check in as a major version and the problem solved....

Thanks a lot..

Thursday, December 15, 2011

Error: "Cannot open database "WSS_Content_...." requested by the login. The login failed. Login failed for user ... "

Today I am converting word to PDF file using Word Automation Service, its throw error like "Cannot open database "WSS_Content_...." requested by the login. The login failed. Login failed for user ... "

Solution :

I have open IIS manager and click on the Application pool. Selected respected site's pool and apply valid user authentication over there. After reset IIS and checked my feature.

Its Working...

Enjoy...

Sunday, June 12, 2011

SharePoint 2010 - i:0#.w|domain\username issue in User

Hi Friend,

Yesterday When I fetched user name through object model, I am getting user name like i:0#.w|domain\username. Because It is possible in claim based authentication in sharepoint.

To Solve this problem, decode the account name.

using Microsoft.SharePoint.Administration.Claims;
SPClaimProviderManager mgr = SPClaimProviderManager.Local;
string strDecodedLoginName = "";


strDecodedLoginName = mgr.DecodeClaim(strLoginName).Value;

Wednesday, June 8, 2011

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.System.Web.Services in sharepoint 2010

Hi Guys,

Today I am connect to SharePoint web service from external machine but I am getting error "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.System.Web.Services ".

I searched on Google and found below solution.

//Trust all certificates
System.Net.ServicePointManager.ServerCertificateValidationCallback =
((sender, certificate, chain, sslPolicyErrors) => true);



Tuesday, May 31, 2011

SMTP Detail From Central Administration

Hi Friends,

You will get SMTP configuration detail from central admin which is useful in webpart or workflow for email trigger.

using Microsoft.SharePoint.Administration;

string smtpServer = SPAdministrationWebApplication.Local.OutboundMailServiceInstance.Server.Address;

string smtpFrom = SPAdministrationWebApplication.Local.OutboundMailSenderAddress;

Friday, March 4, 2011

Word To PDF - Sharepoint 2010

http://msdn.microsoft.com/en-us/library/ff181518.aspx

http://www.microsoft.com/resources/msdn/en-us/office/media/video/office.html?cid=office-video&VideoID=e784efe4-bf2a-4777-b15f-b5a59cecfe64&from=mscomoffice

Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site. Error occurs while deploying SharePoint solut

In Visual Studio 2010 while deploying SharePoint solutions, sometime we see this error
“Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.”

This is because we forgot to mention the Site URL where we are going to deploy this solution. After specifying site URL, deployment went well.



Site URL will be your SharePoint site i.e. http://MOSS:2000.

Sunday, February 13, 2011

How To Write Exception error In Sharepoint Log File

Add Microsoft.Office.Server dll in your project, you can find this dll under “\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\”.

The log files are found under \Common Files\Microsoft Shared\Web Server Extensions\12\Log\. Following line of code is used to write exception in sharepoint default log file.

Microsoft.Office.Server.Diagnostic.PortalLog.LogString(“Exception – {0} – {1} – {2}”,”Log Message”,ex.Message,ex.StackTrace);

Wednesday, February 9, 2011

Disable SharePoint DataTime Control Event

((TextBox)(dtduedate.Controls[0])).Attributes.Add("onKeyPress", "DisbleEnterKey();");

Tuesday, December 28, 2010

Parser Error in sharepoint


Today I have faced parser error in SharePoint when someone has changed compat.browser file in
SharePoint designer.

After searching in Google, I found that some of file App_Browsers folder was corrupted. I have deleted file from folder and reset IIS. My site is working fine.





Friday, November 12, 2010

Unable to cast object of type 'Microsoft.SharePoint.Administration.SPWebApplication' to type 'Microsoft.SharePoint.SPSite

Today I have found error "Unable to cast object of type Microsoft.SharePoint.Administration.SPWebApplication' to type 'Microsoft.SharePoint.SPSite" during deploy moss 2010 solution.

I have set scope as "Site" and due to that above issue is occured.
I have changed scope as "WebApplication" and rebuild it and after deploy it.
So Its working Fine and solution is deployed successfully.

Cheers.

Monday, May 31, 2010

Using SharePoint Calculated Columns to Display Current Month List Items


  1. Created First Day Of Month

    =DATE(YEAR([Created]),MONTH([Created]),1)

  2. Created Last Day Of Month

    =DATE(YEAR([Created]),MONTH([Created])+1,1)-1

I then added the below filters to view:



Thursday, May 27, 2010

How to get current logged in user in sharepoint object model

using (SPSite site = new SPSite(SPContext.Current.Web.Url.ToString()))
{
using (Microsoft.SharePoint.SPWeb web1 = site.OpenWeb())
{
using (Microsoft.SharePoint.SPWeb web = SPControl.GetContextWeb(Context))

{

SPUser currentuser = web.CurrentUser;

}
}
}

Tuesday, May 18, 2010

MOSS 2007 Problem : Cannot connect to the configuration database.

Hi Guys,

During my work with MOSS 2007,i had some performance issues regarding the SQL Server instance services which is running the configuration and Data for MOSS sites.

I had closed this service bymistake and when i'm trying to open the central administration site or any site i got this message in the IR:

"Cannot connect to the configuration database."

To resolve this : go to your services and start this service:
"SQL Server (MSSQLSERVERS)"

This Tip is enough to continue your work with your MOSS sites.

Hope this helps

Monday, May 11, 2009

Export To Excel in Sharepoint

Today I have facing problem in my user control web part when i exported grid view data into excel.

Error is like "control not load at form server tag".

I have created new ASPX page and generate grid and write code for export to excel.
After put this control into sharepoint 12 hive folder like "_Layout".

I have added Page View web part in page and added property link like "http://localhost/_layout/exportToExcel.aspx".

So its working fine.
Put following code in ASPX page.

public override void VerifyRenderingInServerForm(Control control)

{

}

Wednesday, April 8, 2009

Improve Sharepoint Site Performance using Blogcache

When a SharePoint is application is created, a web.config file is created in the application folder you specified. One of the entries inside the SharePoint element is BlobCache. By default, it looks like this:

<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" enabled="false" />

In order to improve the performance of your site, the BlobCache should be enabled.

<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" enabled="true" />

The maxSize attribute is in GigaBytes, so make sure you have enough room at the location.


See this article for more information about other caching techniques: http://blogs.msdn.com/ecm/archive/2006/11/08/how-to-make-your-moss-2007-web-site-faster-with-caching.aspx