16 December 2011

Validate Login User with AD/LDAP authentication(Login Page)

Validating users against Active Directory/ LDAP. Also many organisation have multiple domains and same application needs to validate accross all domain.

This code can be used in SharePoint custom Login form for user Validation for Claim based authentication or Form Based Authentication.

Reference Added :

using System.Runtime.InteropServices;

COMException : The exception that is thrown when an unrecognized HRESULT is returned from a COM method call for more simplified error response from LDAP Error: Unknown error (0x80005000).

using System.DirectoryServices;

Below is the code sniplet

using (DirectoryEntry entry = new DirectoryEntry())
entry.Username = "DOMAIN\\LOGINNAME";
entry.Password = "PASSWORD";
DirectorySearcher searcher = new DirectorySearcher(entry);
searcher.Filter = "(objectclass=user)";
//Add Your Code if user Found..
catch (COMException ex)
if (ex.ErrorCode == -2147023570)
// Login or password is incorrect

ErrorCode : -2147023570 suggest the Username or password is not correctly entered.

post your questions, comments or suggestion.

10 December 2011

Hide the extension .aspx in the url of page ...

Now a days customers are more concerned with site URL and its relative path displayed on the browser address.
Many Suggest having interceptor/handler or use the existing global.asax (Application_Begin Request handler) for modifying the URL shown in the browser window, Web Routing is the concept (4.0 framework)

However you can get solution for .Net /sharepoint application there are following ways:
  1. MVC
  2. HttpModule rewrite URL
  3. ISAPIRewrite to enable Extension-less URL Rewriting for IIS5 and IIS6
  4. IIS level extension parsing
Step by step approaches refer below links:
URL Rewriting in ASP.NET
URL Rewriting in Asp.net
URL rewrite/Routing (4.0 framework concept) *
IIS Forum for Extension parsing

 Let me know your comments /feedback for the same

16 August 2011

ASP .Net Page Life cycle

There are many post related to page life cycle. but the mentioned is really the best provided
Graphical View for Page Life Cycle

24 June 2011

Grid with Content Query Webpart

Here I'm sharing link to get Display Content Query Web Part Results in a Grid / Table well explained by Paul.
.Click here to view

17 February 2011

Sandbox Solution: Overview

What is sandbox solution

Sandbox is a restricted environment where programs are deployed with restrictions. It plays valuable role for developers to test their application by using sandbox solution. Once this is tested it can be later deployed to full use in the farm.

Solution that are deployed into sandbox are called sandbox solutions.

If farm is load balanced.
Release code which is fully not tested for production release.
Less bottleneck for farm administrator as this can be managed at site collection by administrator to it.

First decide whether you want this solution? as using this solution does has impact on performance of the servers. As the farm using sandbox does have more process load than a farm without this.
Code Access Security (CAS) limits the operations that the code can perform

How to use

Activate SharePoint 2010 User Code Host service(SPUCHostService.exe,)  on server you want this solution. Should be done by farm administrator

Sandbox Code Services

Sandbox can be applied at the root of site collection level.
Members of the site collection administrators group can deploy sandboxed solutions

Governance for sandbox

Before deploying think of below

When should the solution be blocked or unblocked?
When to release the solution to production?
Who should be given access, deployment rights etc?

Adding / Blocking /Load Balancing for Sandbox

This can be done via CA – System settings

Special Thanks :Amarprit Jaspal

26 January 2011

List of Content Managment Systems.

In today's world Content Management System is core requirement for a business oriented system more and more companies developing their business standard directly influencing the need for CMS to hand their operation.

For all CMS lovers here is consolidated list fro all the management systems present till dated.
Click Here  By Wiki

Rate Now: