Friday, September 13, 2013

Assembly {0} does not contain a Web resource with name {0}

Assembly 'ABC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' contains a Web resource with name 'PasswordExtenderBehavior.js', but does not contain an embedded resource with name 'PasswordExtenderBehavior.js'.
for this we need to select "PasswordExtenderBehavior.js" right click and go to properties select BUILD Action-> Embedded Resource 

Friday, September 6, 2013

Open MS CRM Form in Classic Mode always

Add the below code in Ribbon button. Whenever you click on that button the form will open in Classic Mode

function openClassicForm() {
 var name =Xrm.Page.data.entity.getEntityName();
 var id =Xrm.Page.data.entity.getId();
  var clientUrl = Xrm.Page.context.getClientUrl();
  var url = clientUrl + "/main.aspx?etn=" + name + "&extraqs=%3fid%3d" + id + "%26&pagetype=entityrecord&rof=true";
  parent.parent.window.open(url);
}

Monday, September 2, 2013

Check the Username and Password from Active Directory

using System.DirectoryServices.Protocols;[Add this reference]

namespace Usernamepassword
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
              LdapConnection connection = new LdapConnection("domain.com");
              //Ex:Gmail.com
              NetworkCredential credential = new NetworkCredential("username", "Password");
                connection.Credential = credential;
                connection.Bind();
                Console.WriteLine("Succesfully Logged In");
                Console.ReadKey();
            }
            catch (LdapException msg)
            {
                String error = msg.ServerErrorMessage;
                Console.WriteLine(msg);
                Console.ReadKey();
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc);
                Console.ReadKey();
            }
        }
    }
}