Priyang Patel’s Weblog

Doloto : AJAX application optimization tool

Posted in JQuery,Optimization by priyangpatel on January 19, 2010

Doloto is an AJAX application optimization tool, especially useful for large and complex Web 2.0 applications that contain a lot of code, such as Bing Maps, Hotmail, etc. Doloto analyzes AJAX application workloads and automatically performs code splitting of existing large Web 2.0 applications. After being processed by Doloto, an application will initially transfer only the portion of code necessary for application initialization.

The rest of the application’s code is replaced by short stubs — their actual function code is transferred lazily in the background or, at the latest, on-demand on first execution. Since code download is interleaved with application execution, users can start interacting with the Web application much sooner, without waiting for the code that implements extra, unused features.

In our experiments across a number of AJAX applications and network conditions, Doloto reduced the amount of initial downloaded JavaScript code by over 40%, or hundreds of kilobytes resulting in startup often faster by 30-40%, depending on network conditions.

Read more over here …

RESTful Services With ASP.NET MVC

Posted in MVC by priyangpatel on September 10, 2009

I have found a very nice article of create RESTful Services With ASP.NET MVC.

?? Operator (null-coalescing operator)

Posted in C# 3.0 by priyangpatel on September 10, 2009

?? is used to define a default value for a nullable value types as well as reference types. It returns the left-hand operand if it is not null; otherwise it returns the right operand.

A nullable type can contain a value, or it can be undefined. The ?? operator defines the default value to be returned when a nullable type is assigned to a non-nullable type. If you try to assign a nullable value type to a non-nullable value type without using the ?? operator, you will generate a compile-time error. If you use a cast, and the nullable value type is currently undefined, an InvalidOperationException exception will be thrown.



SSRS 2005 limitations :

Posted in SSRS (Sql Server Reporting Services) by priyangpatel on September 7, 2009

I am working with SSRS (Sql Server Reporting Services) 2005 since last 8 months and i came across many limitations which should not be there with SSRS . SSRS is still getting matured so please go through following list before choosing SSRS 2005 for reporting in your system.

Does not support dynamic width for columns:

SSRS doesn’t support dynamic width for columns , also the main problem I found is if you will disable one column based on condition then remaining columns width won’t get adjusted to use hidden columns space. And its very frustrating.

Doesn’t support HTML rendering !!!!!!!!!:

Yes, Its correct that SSRS 2005 doesn’t support HTML rendering of sent data. It is really surprising for me.

CanGrow property :

SSRS controls have cangrow property, if its true then controls will grow based on its contents width. But its can grow in vertical direction but not in horizontal…..

If this property is set to false then it will auto trim data based on controls width. and then if you want to show “…” to show there are some more  data then you are in real trouble.

There are some more limitations are mentioned at here.

Hope all this problems are solved with SSRS 2008….:)

Some nice MVC videos

Posted in MVC by priyangpatel on September 3, 2009

Some really nice videos of MVC presented by Phil Haack.

Choosing between ASP.NET Web Forms and MVC
ASP.NET MVC: America’s Next Top Model View Controller Framework
Microsoft ASP.NET Model View Controller (MVC): Ninja on Fire Black Belt Tips


Something about MVC (Model View Controller)!!!

Posted in MVC by priyangpatel on March 25, 2009


I heard so much about MVC and want to share some basic things about MVC.

Basically MVC is a design pattern defined many years back  and ASP.NET MVC Framework is the framework to implement MVC pattern.

As Per wordPress the defination of MVC Pattern is

Model–View–Controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic fromuser interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model.”

Now lets understand MVC Framework.


MVC is a framework methodology that divides an application’s implementation into three component roles: models, views, and controllers.

  • “Models” in a MVC based application are the components of the application that are responsible for maintaining state.  Often this state is persisted inside a database (for example: we might have a Product class that is used to represent order data from the Products table inside SQL).
  • “Views” in a MVC based application are the components responsible for displaying the application’s user interface.  Typically this UI is created off of the model data (for example: we might create an Product “Edit” view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object).
  • “Controllers” in a MVC based application are the components responsible for handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI.  In a MVC application the view is only about displaying information – it is the controller that handles and responds to user input and interaction.

One of the benefits of using a MVC methodology is that it helps enforce a clean separation of concerns between the models, views and controllers within an application.  Maintaining a clean separation of concerns makes the testing of applications much easier, since the contract between different application components are more clearly defined and articulated.

The MVC pattern can also help enable red/green test driven development (TDD) – where you implement automated unit tests, which define and verify the requirements of new code, first before you actually write the code itself.

















Some benefits of MVC are :

  • Clear separation of concerns
  • Testability – support for Test-Driven Development
  • Fine-grained control over HTML and JavaScript
  • Intuitive URLs

I will try to post more and more things about MVC.

Increase your productivity using visual studio 2008

Posted in Visual Studio Tips and Tricks by priyangpatel on June 3, 2008

Basic Building Commands:

It’s an obvious and trivial thing, but the timesaving will add up, especially for those actions you perform tens or hundreds of times a day such as building and debugging. Here are some basic bindings every Visual Studio developer should know:

  • Build: CTRL + SHIFT + B
  • Word completion: CTRL + SPACE
  • Start with debugging: F5
  • Start without debugging: CTRL + F5

Download the Visual C# 2008 Keybinding Reference Poster.

Use GhostDoc to create XML Comments

Instead of typing XML comments by hand, let a tool do the work for you. Although macros and snippets are reasonably effective for this, I would recommend Ghost Doc over any other solution. This free add-in uses customizable templates to generate consistent, English-readable documentation based on the current context. To use it, right-click (or use CTRL + SHIFT + D) to document the current element. For example:

This generates the following documentation:

Auto-Implement Properties

Take advantage of a new feature of C#: auto-implemented properties. Rather than creating a private backing field for your properties, let the compiler do it for you. The following demonstrates the syntax:

Use the code snippet to make this even faster. Type prop (the shortcut for an auto-implemented property) followed by TAB TAB. Then fill in the data type and property name:

The refactor feature in Visual Studio is indispensable for many tasks, especially renaming, but one productivity feature I particularly like is Encapsulate Field. If you are unable to use an auto-implemented property, declare a private field and let Visual Studio generate the Property for you. To use this feature, right-click on the field and select Refactor > Encapsulate Field…

The property is created for you:

Add Commands to Visual Studio 2008

Install the PowerCommands for Visual Studio 2008 to add several productivity commands such as:

  • Close all documents
  • Copy and paste a class (automatically renames)
  • Remove and sort using statements project-wide
  • Copy and paste references (including a project reference)

Install the Team Foundation Server Power Tools to add several TFS productivity commands such as:

  • Find in source control
  • Open source folder in Windows Explorer
  • Work item templates (can be used to set values on multiple work items at once)

Add your own productivity commands. For example, to add Reflector so it automatically opens on the current project.

  • Select Tools > External Tools
  • Click Add
  • Name it Reflector and browse to the executable
  • Enter $(TargetPath) for the Arguments

Speed up Compilation with Project Configuration

You may build tens of times during a programming session, so don’t enable anything that isn’t absolute necessary such as code analysis and XML documentation. Develop in Debug configuration, and switch to Release configuration just before check-in to run code analysis and generate XML documentation. In a large solution I recently worked on, this shaved a minute off compilation time.

The following shows code analysis disabled in Debug configuration:

Let Visual Studio Generate Unit Test Code

Although it can’t fully automate unit testing yet (check out Pex), Visual Studio does a good job of generating positive unit test code to give you a jump start. To use this feature, right-click on an element you would like to test and select Create Unit Tests…

Visual Studio generates the following test method:

Find files faster with Find Combo Box !!!!

Posted in Visual Studio Tips and Tricks by priyangpatel on May 30, 2008

This is the Find dropdown that is on the Standard Toolbar, not the Find dialog. Use the shortcut CTRL+D to activate the Find dropdown in normal mode. Use CTRL+/ to activate the Find dropdown in command mode (with “>” prepended… this doesn’t work sometimes for me).

To quickly go to a file, type CTRL+D, >open . Intellisense works here just like in the Command Window. “of” (short for “open file”) can be used instead of open. Compare this with opening Solution Explorer, expand the correct folder/project, and visually hunt for the file you need.

Start debugging faster by "Attach to Process"

Posted in Visual Studio Tips and Tricks by priyangpatel on May 30, 2008

Most ASP.NET developers use the standard F5 (Debug/Start Debugging) to start debugging from Visual Studio. However, there is a much faster way to start debugging if you already have an instance of your web application running. Just attach to it instead:

  • Choose Debug/Attach to Process.
  • Select the “aspnet_wp.exe” process and choose Attach.

Debugging this way is faster because you skip the often-lengthy compilation step, and you don’t have to navigate from the start page to the actual page that you want to debug.

Enjoy Code Snippet with Visual Studio 2008 !!!!!!!

Posted in Visual Studio Tips and Tricks by priyangpatel on May 27, 2008

If you know what is “Code Snippet” ? & how to use it? with visual studio 2005.

But now if you are using Visual Studio 2008 then you won’t find it. Don’t worry it is not removed from visual studio, you can still use it.

Copy and paste or create your snippet file to following address of your computer:

My Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets

It’s done, just go to visual studio and write down snippet name and press tab.


Next Page »


Get every new post delivered to your Inbox.