-->

26/11/2011

Sharepoint Admin's Best Practices [MSDN]


Best Practices for SP Administration:
1.       Don’t create too many Web applications. Its specified that 4 web applications are enough on a server.
a.       Intranet / Portal
b.      My sites
c.       Team sites
d.      Partner Access
2.       Don’t mess up with IIS settings of Central admin. SP likes to save the changes to Config DB, and Central admin works well as far as IIS Settings and Config settings match.
The only change which has to be done at IIS for Central Admin is SSL Settings.

@Html.Partial() Vs @Html.Action() - MVC Razor


In earlier post we have seen how to render different partial views (each using different model).
By which we displayed both Personal and Professional details of an employee as below:
Now lets look at other aspect.
Objective: I wanna display Professional details of an employee for both 2010 and 2011.
This means Using the same View and Same model but i need different data.
Lets see how this gonna be achieved.

Partial Views with Different Models - MVC Razor


In this post we will see:
1. How to use Different Partial views on a Master View.
2. How to attach models to different Partial Views.


Objective: I wanna create an MVC Razor application which will display both Personnel and Professional Details.

12/11/2011

Cookie Capturing using HttpWebRequest

In this post we will see about how cookies can be captured using HttpWebRequest class.
When ever i say some thing about Cookie, first question people ask me is...
What if Cookies are disabled by Client or User ?
Ok! Let me ask you the same. Be genuine and don't search in Google now.
Tell me steps for how to disable the cookies in IE or Firefox?
I bet half of us don't remember how to disable them.
Being Technical persons, if we can't do that, how a client / user will do that.

If you still  stick to the same, let me tell you not only mine, even your web application won't work in his machine. That is for sure.
Why?

30/10/2011

Custom Controller Factory & Structure Map - MVC Razor


Oww.... wait, why i have to go for Custom Controller Factory ? 
Error shown in earlier post "Default Controller Factory Vs Custom Controller Factory"  is lack of default constroctor. So, i will add one parameter-less constructor. That is it. Problem solved. :)

Sorry, now you have created a bigger problem. Let me show you how.
If you understood the article "Dependency Injection", you will observe the flexibility (Loosely coupled) we achieved because of that.

29/10/2011

Default Controller Factory Vs Custom Controller Factory - MVC Razor


In order to have a better understanding of this, lets start this discussion with MVC Page life cycle.
Let's see step by step how it works.

28/10/2011

Presence Control in Web app


We have seen many ways of implementing presence control in our web application.
The simplest of all of them is a combination of Images with Java script.
Lets see how to implement it.
Before going to actual implementation, we have to answer a few questions.
Why i need to use this one, i have my predefined reusable user controls for presence control ?
Ans: Yes, you can use them unless you answer below questions.
    i. Is it light weight?
    ii. Is it talking to your Messenger service or you want to take the overhead of communicating with exchange server?
    iii. Do you want to have complete control over the functionality and display?
    iv. Do you want to avoid the issues due to lack of complete information regarding references and bugs?
    v. Are you working on MVC Razor which cannot accommodate the heavy weight user controls designed in regular asp.net?

17/10/2011

Digital Certificates & Logic Behind

Digital certificates are electronic credentials that are used to assert the online identities of individuals, computers, and other entities on a network. Digital certificates function similarly to identification cards such as passports and drivers licenses. They are issued by certification authorities (CAs) that must validate the identity of the certificate-holder both before the certificate is issued and when the certificate is used. Common uses include business scenarios requiring authentication, encryption, and digital signing.

Certificate Architecture:
A digital certificate binds a user, computer, or service’s identity to a public key by providing information about the subject of the certificate, the validity of the certificate, and applications and services that can use the certificate. Certificates issued in Windows Server 2003 and earlier PKIs are structured to meet these objectives based on standards established by the Public-Key Infrastructure (X.509) Working Group (PKIX) of the Internet Engineering Tasks Force (IETF). The following figure shows the contents of X.509 version 3

  • Subject. Provides the name of the computer, user, network device, or service that the CA issues the certificate to. The subject name is commonly represented by using an X.500 or Lightweight Directory Access Protocol (LDAP) format.
  • Serial Number. Provides a unique identifier for each certificate that a CA issues.
  • Issuer. Provides a distinguished name for the CA that issued the certificate. The issuer name is commonly represented by using an X.500 or LDAP format.
  • Valid From. Provides the date and time when the certificate becomes valid.
  • Valid To. Provides the date and time when the certificate is no longer considered valid.
    Note
    • The date when an application or service evaluates the certificate must fall between the Valid From and Valid To fields of the certificate for the certificate to be considered valid.
  • Public Key. Contains the public key of the key pair that is associated with the certificate.

WCF - Implementing Message Level Security


Lets start this topic with a comparison between Transport and Message level security.


Transport Level Security
Message Level Security
Scenarios when we should be using one of them
When there are no intermediate systems in between this is the best methodology.  
If it’s an intranet type of solution this is most recommended methodology.
When there are intermediate systems like one more WCF service through which message is routed then message security is the way to go.
Advantages
Does not need any extra coding as protocol inherent security is used.
Performance is better as we can use hardware accelerators to enhance performance.
There is lot of interoperability support and communicating clients do not need to understand WS security as it’s built in the protocol itself.
Does not need any extra coding as protocol inherent security is used.
Performance is better as we can use hardware accelerators to enhance performance.
There is lot of interoperability support and communicating clients do not need to understand WS security as it’s built in the protocol itself.
Disadvantages
As it’s a protocol implemented security so it works only point to point.
As security is dependent on protocol it has limited security support and is bounded to the protocol security limitations.

Needs application refactoring to implement security.
As every message is encrypted and signed there are performance issues.
Does not support interoperability with old ASMX webservices/


So, both Transport and Message level security have their pros and cons.
But, in real time internet scenarios, message level security will be the best pick.

Message Level Security:
Message security uses the WS-Security specification to secure messages. The specification describes enhancements to SOAP messaging to ensure confidentiality, integrity, and authentication at the SOAP message level (instead of the transport level).

16/10/2011

Builder Pattern

Developers have observed that, composing a system using inheritance makes it too rigid.
Creational Pattern is a way to break that tight coupling by abstract out the object creation.
The Creational patterns aim to separate a system from how its objects are created, composed, and represented. They increase the system's flexibility in terms of the what, who, how, and when of object creation. Creational patterns encapsulate the knowledge about which classes a system uses, but they hide the details of how the instances of these classes are created and put together.

Lets start this pattern with a hot snac. "Pizzaaaa . . . "
 Even though i am a non vegetarian, i love "Veggi Delight" than any other flavor. I know its very hard to discuss a design pattern keeping this picture in front of you. But lets stick to topic.
There are lot of variations in Pizza, different sizes, there are different types of bread doughs(base), different types of sauces , different types of toppings that can be used to prepare a pizza.
Now let's cook a pizza in c# mode.