Wednesday, September 3, 2014

Hello folks!

I am sharing two pieces of code that i have recently used while using DevExpress GridView control for Microsoft Visual Studio. Let me appreciate DevExpress in general for making developers life easier by providing very powerful controls for Visual Studio.

Let me quickly come back to the scenario

We have a Gridview control and we need to perform some operation in the code behind and once we are done with code behind stuff then call some Javascript thing.

To carryout this, do the following steps:-

Step 1: Create a custom button under ASPxGridView Command column

Step 2: Generate an event on custom button call back as follows:-

//Code behind on custom button call back
protected void grd_Memos_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomButtonCallbackEventArgs e)
 {
DevExpress.Web.ASPxGridView.ASPxGridView gridView = (DevExpress.Web.ASPxGridView.ASPxGridView)sender;
var Mem_Id = grd_Memos.GetRowValues(e.VisibleIndex, "MEM_ID");
gridView.JSProperties["WindowUrl"] = string.Format("ViewMemoReceipts.aspx?MEM_ID={0}",Mem_Id);
 }


Step 3: Go to ASPxGridView Tasks and choose Client-Side Events and add the code in the EventHandler body of Endcallback as follows:-
function(s, e) {
if (s.WindowUrl != null) window.open(s.WindowUrl);
}

Wednesday, August 6, 2014

How to find Sharepoint edition installed on server?

A quick tip to get sharepoint version using Power Shell
  • Login to server with a user having farm administration rights
  • Run powershell with admin rights
  • Type the following:- asnp Microsoft.Sharepoint.Powershell and hit Enter
  • Type the following:- (Get-SPFarm).products 
  • OR
  • Type the following:- Get-SPFarm| Select products
  • And you will get a list of GUIDs
I am copying list of GUIDs for reference.In my case it is Microsoft Sharpoint Enterprise. Sharepoint foundation is always shown with Enterprise


















BEED1F75-C398-4447-AEF1-E66E1F0DF91E
SharePoint Foundation 2010
88BED06D-8C6B-4E62-AB01-546D6005FE97
SharePoint Server 2010 Enterprise Trial
D5595F62-449B-4061-B0B2-0CBAD410BB51
SharePoint Server 2010 Enterprise
B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0
SharePoint Server 2010 Standard Trial
3FDFBCC8-B3E4-4482-91FA-122C6432805C
SharePoint Server 2010 Standard

Monday, July 14, 2014

HTTP Error 401.3 - Unauthorized You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server


Recently i encountered this issue while deploying an asp.net solution on Windows Server 2008 R2. 
Looking at the error, i was quite sure it has something to do with website permissions. 
By default IIS treats anonymous authentication credentials to Specific User and if that specific user doesn't have permission on wwwroot folder then IIS will throw HTTP 401.3.

Solution

- Go to IIS Application server manager
- Choose IIS -> Authentication
- Edit Anonymous Authentication
- Change Anonymous User Identitiy to Application Pool Identity

hopefully this will work! 

Thursday, April 24, 2014

System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

Recently, i encountered an error after deploying a web application over IIS 7. It was working fine with IIS v6.0 with Windows Server 2003 but on IIS 7 it started giving an error "System.Security.SecurityException" on the line: EventLog.SourceExists(sourceName). Here is what i did to solve this issue:-

- Go to Registry Editor on Windows Server 2008

- Choose HKLM-> SYSTEM->CurrentControlSet->services->eventlog
- Grant Read permission on "Security" node to IIS AppPool\DefaultAppPool User

It will solve the issue of searching through event sources to find whether this source already exists or not.