Search This Blog

Loading...

Thursday, September 29, 2016

Unused Css

If anytime you feel that you have lots of unused CSS classes and find a way to detect them then there is a script available which you can include temporary on your website footer. This will ask you for the page urls which gets scanned for finding unused css classes.


<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/helium-css/1.1/helium.js" onload="helium.init()" async></script>



Once you start the process it will show you all the css classes from all the css files as a report that you can download

Wednesday, September 28, 2016

Html.Partial() Vs Html.RenderPartial()


Html.Partial() Vs Html.RenderPartial():-

Both of these helper methods used for rendering partial views.The following are the diffrences.

1.The return type of "RenderPartial" is void, where as "Partial" returns"MvcHtmlString".
2. Syntax for invoking Partial() and RenderPartial() methods in Razor views
@Html.Partial("NameOfPartialView")
{ Html.RenderPartial("NameOfPartialView");  }

When would you use Partial() or RenderPartial() ?
The main difference is that "RenderPartial()" returns void and the output will be written directly to the output stream, where as the "Partial()" method returns MvcHtmlString, which can be assigned to a variable and manipulate it if required. So, when there is a need to assign the output to a variable for manipulating it, then use Partial(), else use RenderPartial().

Which performance is better? 
From a performance perspective, rendering directly to the output stream is better RenderPartial() does exactly the same thing and is better for performance over Partial().

Monday, September 26, 2016

SharePoint 2016 New Features : MinRole

SharePoint 2016 introduced a new feature named "MinRole" with the help of which, SharePoint Administrators can configure role of each server in a Farm topology.

The option to select MinRole will come when you run the SharePoint 2016 Products and Configuration Wizard. Below  screen shot shows the options available to configure under server role. Kindly note that the option to configure Server Role will appear for both the configuration settings i.e  Creating a new Farm or joining an Existing Farm.



For further reading you can follow Microsoft Technet article here: https://technet.microsoft.com/en-us/library/mt346114(v=office.16).aspx

Tuesday, September 20, 2016

Unobtrusive Validation

Unobtrusive Validation

This lightweight library allows us to add validation to our MVC views without any additional client-side coding. we only have to use attributes like RequiredAttribute and RangeAttribute and include the correct script files. 

MVC includes Unobtrusive Validation with the usage of the jQuery Validate plugin and the Unobtrusive library.

Check out the model for sample
























Model shows set up to handle server-side validation using attributes. Unobtrusive Validation allows us to take the already-existing validation attributes and use them client-side to make user experience that much cool an effective.

Scripts Required

The Unobtrusive script files are included automatically with new MVC projects in Visual Studio, but if you don't have them you can get them from.
Here is link for including Unobtrusive script files :-    Nuget Unobtrusive Package




These are the scripts files after installation of nuget package .

We need three sets of files to implement Unobtrusive validation:
  • jQuery library
  • jQuery Validate plugin
  • Unotrusive extensions to Validate


Make sure all .js file in image above added for Unobtrusive validation.we can add unobtrusive validation to any page by simply including those script files on that page.


Working of validation:

Here is the image depicting the Unobtrusive validation on .cshtml .


There are various ways to show your error message on screen, this one display just below the property.

View of controller


The POST action is super simple,we check for validation errors, and if there are any, we simply return the view.

Enable validation on  client side

We can disable client-side validation in the entire app via the Web.config file, by setting the AppSetting for ClientValidationEnabled to false.
Make sure it is set to true.



For help below sample code is attached: Download Sample





Friday, September 16, 2016

Changing Requirement Causing Stressful Situations

The phrase "Requirements change" is sometimes abused by IT people. What we are describing is indeed change of requirements but this may be because one or more of the following (I don't know enough about these cases, so the following may or may not apply):

1) Management's ambition to make the end user happy as quickly as possible and show quick progress.

2) Lack of detailed analysis. Remember that Analysts need to ask questions about why not only what. The analysts needs to "think" with the end user about a "solution" not only take orders.

3) Lack of a formal process for requirements verification and confirmation, followed by approval.

4) Asking the incorrect person to perform one or more roles they are not necessarily trained for such as Business Analyst or Systems Analyst roles.

5) Limited prototyping.

6) Client not clear about the technicalities and its limitation. They expect to get all whether the thing is technically feasible or not. This cause long discussion sessions which cause change in requirement and the project to delay.
Client should have technical team or atleast a technical person to analyse requirements before delivering this to their vendors.

6) The assumption/fear that it has to be done quickly and if not its IT to blame.

Unless one addresses all of the above properly, the relationship between IT and the business/end user will be stressful. These does not imply that the above point are conclusive. There are other factors also that leads to stressful situations.

Thursday, September 15, 2016

Typography

New technique of typography is change art world.

What is typography?

Typography is the visual art of creating written words. Before the digital age, typography was a rather specialized craft that was confined to the worlds of book and magazine design and a range of advertising and public works.
Typography is often overlooked because it doesn't come off as glamorous as photo retouching and composite artwork. But its really the foundation of good design in advertising, print and web. It's also an intricate part of any good presentation, info graphics and motion graphic design.
Typography is severely under appreciated and undervalued (as are Graphic Designers).
Typing is power of design.to express words ideas visually.

Why Is Important Typography ?

Typography is absolutely everywhere. Just look at your phone, a billboard, your coffee cup, or even the different styles used in this blog post. Every font, letter, and character arrangement plays a part in determining how a message is conveyed.

The Anatomy of a Typeface

Each part of a letter has its own special term, similar to bones in a human body. Below, you’ll see three diagrams that explain the makeup of individual letters, how these elements interact with each other, and how they sit on a line.
Baseline: The line where the letters sit.
Cap height:The distance from the baseline to the top of the capital letter.
X-height: Located in between the baseline and the cap height, it's the height of the body of the lowercase letter. (In this case, it's the letters ‘a,' ‘u,' and ‘y.').
Bowl:The curved part of the character that encloses the circular or curved parts of some letters, like 'd,' 'b,' 'o,' 'D,' and 'B.' (In this case, it's that round shape sticking off the letter ‘a.').
Serif:The slight projection finishing off a stroke of a letter in certain typefaces. (In this case, it's that little foot sticking off the letter ‘l.').
Descender: The longest point on a letter that falls beyond the baseline.

Three most trick of typography

Kerning

Kerning is the amount of spacing between to letters.

Tracking

Tracking is very similar to kerning. Another adjustment to type that has been mentioned is tracking. that it is the spacing between individual characters, but tracking is the space between groups of letters rather than individual letters.

Leading

Leading is the spacing between the baselines of type. Leading is an essential design aspect that determines how text is spaced vertically in lines.

Microsoft Dynamics CRM 2013 Internet Facing Deployment (IFD)

This post will cover all the steps that need to be follow to configure Internet facing deployment (IFD) for Microsoft Dynamics CRM 2013 On premise deployment.


Environments:

  1. Dynamics CRM Server 2013 installed on Windows Server 2012 R2 Standard.
  2. ADFS 2.0 server on a separate Windows Server 2012 Standard.
First you will need to purchase the appropriate certificates for the IFD configuration or you can create your own domain certificates and bind them with the sites as described in below:
  
Steps to create domain certificate:
1. First go to the ADFS server and open IIS manager and then go to server certificates then create a domain certificate.


 

 

C:\Users\deepak.jangra\Desktop\IFD images\Create Certificate.png

     
2. In the next step specify the certification authority and enter the friendly name. Click finish.



    C:\Users\deepak.jangra\Desktop\IFD images\Create Certificate1.png

    3. Now export this certificate from the ADFS Server.

     
    Import the certificate to CRM Server.
     


    After this we need to bind the certificate with ADFS server site as mentioned below:

    1. Go to the default website of ADFS server in IIS manager right click the default site and click on edit bindings...

    C:\Users\deepak.jangra\Desktop\IFD images\Create Certificate2.png

    2. Under Type, select https.

    Under SSL certificate, select your SSL certificate and then click OK and then Close.
    C:\Users\deepak.jangra\Desktop\IFD images\Create Certificate3.png

    C:\Users\deepak.jangra\Desktop\IFD images\Create Certificate5.png

    C:\Users\deepak.jangra\Desktop\IFD images\Create Certificate4.png

    3. Repeat the above step 1 and 2 for Dynamics CRM site as well on the CRM Server.

     

    Now the CRMAppPool account will need to have rights to the certificate.


    In my case CRMAppPool is running under Network Service account so i need to give read permission to the certificate for the Network Service account.






    Follow below steps to give permission to Network Service account:


    1. Launch the MMC (Microsoft Management Console) console and go to File menu and select Add-Remove Snap In.



    2. Select Certificates from the available snap-ins and click Add

     

    3. Select Computer Account and click Next.


    4. Click Finish on the next window and then click Ok.


    5. Expand Certificates->Personal->Certificates ->Right click on Manage Private keys

    6. Select the Network Service which is running the CRM application pool and give it read permissions and then Ok.




    Now follow below steps to setup ADFS on the Server.

    1. Launch Server manager and click on Add roles and features.

          
    1. Click Next
       C:\Users\deepak.jangra\Desktop\IFD images\adfs.png
    1. Select Role-based or feature based installation and click Next

       C:\Users\deepak.jangra\Desktop\IFD images\adfs1.png
    1. Select a server from the server pool and click Next
    1. Select Active Directory Federation Services
    C:\Users\deepak.jangra\Desktop\IFD images\adfs3.png
    1. Click on Add Features and then click Next
    C:\Users\deepak.jangra\Desktop\IFD images\adfs4.png
    1. Then on the confirmation page click Install.
    C:\Users\deepak.jangra\Desktop\IFD images\adfs5.png

    Once ADFS get installed then we need to configure that:

     

    1. Launch Administrative tools and then select ADFS management. 

    image
    2. Click on ADFS Federation Server Configuration Wizard and then select Create a new Federation Service and click Next
    image
    3. Now depending upon your requirement you can choose the appropriate option. The screen explains each of the options.

    I will choose New federation server farm.

    C:\Users\deepak.jangra\Desktop\IFD images\adfs6.png
    4. Specify the Federation Service Name.
    C:\Users\deepak.jangra\Desktop\IFD images\adfs7.png
    5. Shows you the summary of what is about to be installed. Click Next to continue.

    image 

    6. Wait for the configuration process to complete and click the Close button. 
    image

     Configuring CRM server for claims based authentication


    Now the next step is to configure Dynamics CRM for claims based authentication.
    Go to CRM Server and open the Deployment Manager and then go to properties and select the tab Web Address.

     
    C:\Users\deepak.jangra\Desktop\IFD images\CRMClaim.png


    Now enter the internal network URL for CRM and update the binding type to HTTPS then click on "Apply".

    2. Now go to Configure Claims-Based Authentication in the deployment manager.

       
    image 

    3. On the Specify the security token service page, enter the Federation metadata URL, such as https://adfs.techperspect.com/federationmetadata/2007-06/federationmetadata.xml and click Next. To verify the correct URL, open an Internet browser by using the URL to view the federation metadata. Verify that no certificate-related warnings appear.

    C:\Users\deepak.jangra\Desktop\IFD images\CRMClaim2.png
    4. Now specify the encryption certificate and click Next

     
    5. On the System Checks page, review the results, perform any steps required to fix problems, and then click Next


    6. On the Review your selections and then click Apply page, verify your selections, and then click Apply.


    7. Click View log file and scroll to the bottom and copy the Federation metadata URL we will need that in further steps.
    C:\Users\deepak.jangra\Desktop\IFD images\CRMClaim3.png

    Now we need to configure claims provider trusts and relying party trusts on ADFS Server.

    Follow below mentioned steps:
    1. Start ADFS Management on the ADFS Server and in the Navigation Pane, expand Trust Relationships, and then click Claims Provider Trusts. Under Claims Provider Trusts, right-click Active Directory, and then click Edit Claims Rules.


       
    image
    1. In the Rules Editor, click Add Rule, In the Claim rule template list, select the Send LDAP Attributes as Claims template, and then click Next
    image
    1. Create the following rule
    Claim rule name: UPN Claim Rule (or something descriptive)
    Attribute store: Active Directory
    LDAP Attribute: User Principal Name
    Outgoing Claim Type: UPN
    Click Finish, and then click OK to close the Rules Editor
    image
    After you enable claims-based authentication, you must configure Dynamics CRM Server 2013 as a relying party to consume claims from ADFS for authenticating internal claims access.
    1. Start ADFS Management. On the Actions menu located in the right column, click Add Relying Party Trust. In the Add Relying Party Trust Wizard, click Start.


    1. On the Select Data Source page, click Import data about the relying party published online or on a local network, and then type the URL you copied earlier from the log file. So that will be https://crm.techperspect.com/FederationMetadata/2007-06/FederationMetadata.xml.
    Verify that no certificate-related warnings appear by opening it in the browser. 
    C:\Users\deepak.jangra\Desktop\IFD images\CRMClaim4.png 

    1. On the Specify Display Name page, type a display name, such as CRM Claims Relying Party, and then click Next
    image
    1. On the Choose Issuance Authorization Rules page, leave the Permit all users to access this relying party option selected, and then click Next
    image 

    1. On the Ready to Add Trust page, click Next, and then click Close.
    C:\Users\deepak.jangra\Desktop\IFD images\CRMClaim5.png 

    1. If the Rules Editor appears, click Add Rule. Otherwise, in the Relying Party Trusts list, right-click the relying party object that you created, click Edit Claims Rules, and then click Add Rule.
    image 
    1. In the Claim rule template list, select the Pass Through or Filter an Incoming Claim template, and then click Next.
    image
    1. Create the following Rule #1
    Claim rule name: Pass Through UPN (or something descriptive)
    Incoming claim type: UPN
    Pass through all claim values
    Click Finish.
    image 

    1. In the Rules Editor, click Add Rule, in the Claim rule template list, select the Pass Through or Filter an Incoming Claim template, and then click Next.
    image 
    1. Create the following Rule #2
    Claim rule name: Pass Through Primary SID (or something descriptive)
    Incoming claim type: Primary SID
    Pass through all claim values
    Click Finish
    image 
    1. In the Rules Editor, click Add Rule. In the Claim rule template list, select the Transform an Incoming Claim template, and then click Next.
    image 

    1. Create the following rule #3
    Claim rule name: Transform Windows Account Name to Name (or something descriptive)
    Incoming claiming type: Windows account name
    Outgoing claim type: Name
    Pass through all claim values
    Click Finish, and when you have created all three rules, click OK to close the Rules Editor.
    image
    So now we have claims setup for CRM.
    In both Servers (ADFS and CRM) go to IE -> tools -> IE options -> security-> local intranet -> sites -> add internal URL and ADFS URL (https://crm.techperspect.com and https://adfs.techperspect.com ) This would have to done on any machines that are accessing the internal access points so that ADFS and CRM can pass those Kerberos tickets without being prompted for credentials.


    Now at last we need to configure CRM Server for IFD

    Go to the the CRM Server and follow below steps:

    1. Start the Deployment Manager. In the Deployment Manager console tree, right-click Microsoft Dynamics CRM, and then click Configure Internet-Facing Deployment. Click Next.
    image
    1. Enter the URLs for the Web Application Server Domain, Organization Web Service Domain and the Discovery Web Service Domain and click on the Next button.


    C:\Users\deepak.jangra\Desktop\IFD images\CRMIFD.png
    1. In the Enter the external domain where your Internet-facing servers are located box, type the external domain information where your Internet-facing Microsoft Dynamics CRM Server 2013 servers are located, and then click Next.
    The domain you specify must be a sub-domain of the Web Application Server Domain specified in the previous step. By default, "auth." is pre-pended to the Web Application Server Domain.
    C:\Users\deepak.jangra\Desktop\IFD images\CRMIFD1.png
    1. On the System Checks page, review the results, fix any problems, and then click Next.
    image 
    1. On the Review your selections and then click Apply page, verify your selections, and then click Apply and Finish.
    C:\Users\deepak.jangra\Desktop\IFD images\CRMIFD2.png
    1. Now do the IIS Reset.

    Test the accessibility of Microsoft Dynamics CRM


    You should now be able to access Microsoft Dynamics CRM Server 2013 externally using claims authentication. As shown below.C:\Users\deepak.jangra\Desktop\IFD images\CRMIFD2.png

    References:

    • https://technet.microsoft.com/en-us/library/gg188602.aspx
    • https://technet.microsoft.com/en-us/library/hh699814.aspx
    • http://blogs.msdn.com/b/niran_belliappa/archive/2014/01/16/step-by-step-configuring-crm-2013-internet-facing-deployment-ifd.aspx
    • http://www.interactivewebs.com/blog/index.php/crm/how-to-set-up-crm-2015-ifd-on-windows-2012-and-adfs-3-0/