Sunday, 30 January 2011

Domain-Driven Design (DDD)

DDD is a collection of patterns and best practices to address software complexities and make them more understandable and manageable.

Friday, 28 January 2011

What Can't You Do With FireBug?

Spend some time reviewing the great features of firebug here.

Tuesday, 18 January 2011

How to Enable SessionState in SharePoint 2010?

You'd like to use session object in your code but you receive an error saying that by default it's disabled.

You'd need to make these changes in the web.config of your application:

1) add the SessionStateModule assembly
<add name="SessionState" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

2) Add a http module
<httpModules>
<add name="SessionState" type="System.Web.SessionState.SessionStateModule" />
</httpModules>

3) Enable session state
<pages enableSessionState="true" ... />

Wednesday, 12 January 2011

How to compress JS files?

Using js-builder, you can combine and compress JS files and resources from a simple user interface which improves the performance and download time of these files.


Another approach is using the ASP.NET 4.5 Bundling and Minification features: http://weblogs.asp.net/scottgu/archive/2011/11/27/new-bundling-and-minification-support-asp-net-4-5-series.aspx

Tuesday, 11 January 2011

ExtJS

It's another javascript library like JQuery but perhaps with more features and controls and we currently use it!

Sunday, 9 January 2011

How to Configure Url Rewrite Module in IIS 7.0?

Url Rewrite module is a free IIS 7.0 module which helps you implement url rewriting.

Ok, what is url rewriting anyway? for example you might want to let users use this url {0} and in the background you'd like that request to be sent to this url {1}.

{0}: http://sitename/productId=1
{1}: http://sitename/products/productdetails.aspx?pid=1
Reverse proxy with url rewrite can be used when you need to rewrite an external url into your original url. By external url, I mean a url which is not on the same site.

Rules:
There are 2 ways to define the rules either using web.config or using IIS Url Writing section; both of these are sync with each other.

SSL Offloading:
When you enable SSL Offloading in IIS, then communication between ARR to the contents server will be using clear text rather than SSL.

Friday, 7 January 2011

URL Rewrite vs URL Redirect

http://recomparison.com/comparisons/101037/url-rewrite-vs-redirect/

URL Rewrite
  • Is a server side operation which means the rewriting is done at the server
  • May result in a static page, a dynamic page, or an image file
URL Redirect
  • Is a client side operation
  • Accepts the request then sends a response to the client immediately with the new URL
  • Therefore, it causes the client browser to make a second request with the new URL

Thursday, 6 January 2011

How to Add Custom CSS and JS files to Your Visual Web Part

Adding CSS

1. Add "Layouts" mapped folder to Visual WebPart Project.

2. Create a folder structure layouts/styles/themable

3. Add the css file to the styles folder .If you are using themable styles then also add it to themable folder too

4. Register the CSS file by adding following line into your visual webpart

<SharePoint:CssRegistration ID="cssId" name="/_layouts/projectName/cssName.css" runat="server" />

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.cssregistration.aspx

(Note: Another approach From sharepoint designer add css file to style library and refer it in css registration)

Adding JS

1. Add "Layouts" mapped folder to Visual WebPart Project.

2. Add you JS file to layout folder or your project specific folder

3. Add the script link to your webpart

<SharePoint:ScriptLink ID="scriptLinkId" name="ProjectName/jsFileName.js" runat="server" />