Modify “Dirty Indicator” – Using Visual Studio 2010 Productivity Power Tool

Dirty Indicator” is nothing but the indication of “Modified Unsaved” file in Visual Studio IDE. In Visual Studio 2010, by default dirty icon shows as “*”. Using productivity tool we can customize this icon.

To launch the VS 2010 productivity Tool, from Visual Studio IDE Go To Tools > Option > Productivity Power Tool

DirtyIndicator_Option 

You will find the Dirty Indicator under Document Tab Well > General Settings . Dirty Indicator having 4 different value, by default sets to “Default” which means it will indicate unsaved modified file as “*” .

DirtyIndicatorstart

Advertisements

Use “Shift+Enter” to add “;” automatically at end of the line – Visual Studio 2010 Productivity Power Tool

Visual Studio 2010 Productivity power tools introduced many new features for VS developer. Here I am going to talk about one small but useful features of the productivity tool.   You can use “Shift + Enter” to add semicolon (;) to end of the line. Instead  of putting “;” end of the line, you just press “Shift+Enter”. It will automatically add “;” at the end of the line and will move the cursor to next line.

ShiftEnter

As shown in the picture. If you press “Shift+Enter” over there, power tool will automatically add “;” and the end and the cursor will be moved to next line.

MoveCursor

For more features please read following links :

http://weblogs.asp.net/scottgu/archive/2010/07/19/vs-2010-productivity-power-tools-update-with-some-cool-new-features.aspx

http://blogs.msdn.com/b/visualstudio/archive/2010/07/18/new-version-of-the-productivity-power-tools-is-available.aspx

Shout it

“View this as root” – A Solution Navigator features in VS 2010 Productivity Power Tools

Visual Studio 2010 productivity power tool introduced many new and interesting features with in the Visual studio 2010 which are really great for developer and will help all of us improve the productivity. You can download the Productivity tool from http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef .

Solution Navigator is a new window that has been introduced with in this power tool which is an enhanced Solution Explorer. This window having many features like search code, highlight code, code navigation, File open, save, edit status etc. Along with these features one of the interesting features that I liked is “View this as root”. This features is very much helpful when you have the many projects with in a solution or your solution hierarchy is large. To start “Solution Navigator” , go to View > Solution Navigator or use (Ctrl + W, F) as shortcut key.This will open the “Solution Navigator” window.

SolutionNavigator

Look and feel wise it is same as “Solution Explorer” but  functionally it is quite different. You will find a “icon” at the right to side with all the files/folder under that solution as shown in below picture.

Bing Maps Silverlight Control Integration with SharePoint 2010 – Integration of Silverlight 4 with SharePoint 2010

In this article I have demonstrated how we can integrate a Silverlight Application with SharePoint 2010. I have used Bing Maps Control for Silverlight as example.



Development Environment

I have used below development Environment for this application

1. Visual Studio 2010 Ultimate Edition

2. SharePoint 2010 Server

3. Silverlight 4.0 Toolkit

4. Bing Maps Silverlight Control SDK

Before starting development you have to install “Bing Maps Silverlight Control SDK” as a prerequisite. You can download the same from “Bing Maps Silverlight Control SDK” .Once you are done with the setup of Development environment the first thing you need to do is to register and create an account at https://www.bingmapsportal.com/ . Once you registered on bing maps portal, you need to provide below information to get an access key for using Bing Maps.

Custom web parts not getting displayed after deployment in share point 2010. how to resolve ?

In Share point 2010, we can create Visual Web parts very easily from Visual studio and can deploy it directly from Visual Studio. After deployment, when adding a web part on a sharepoint page you might face the issue that custom web parts are not getting displayed under custom web parts section though your deployment was successful from Visual Studio.

Fig :  No web parts after deployment

This problem might happen due to activation of features list of your corresponding web parts.  To resolved this issue you need to perform the following steps.

How to pass ASP.NET server side array to client side and binding them with Html element?

This is a very often requirement for an ASP.NET Developer to pass a sever side array to client side and access them through java Script. There are several ways to do that. But here I am describing one of the simplest steps to pass server side array to client side. In this blog post you will get to know two things, first one is the how to pass the array from server side to client side and second one is the how to bind that array to an empty “html dropdown” list.

Well, the easiest way to pass the server side array to a client side is  using  “RegisterArrayDeclaration” . RegisterArrayDeclaration method registers a javascript array with the System.Web.UI.Page Object. As the array object registered with the “Page” object so we can access it from javascript easily. RegisterArrayDeclaration takes array name and value of the array element as argument.

In below example, I have registered one array with name of “Skills”.

  protected void Page_Load(object sender, EventArgs e)
    {
       // Register List of Languages
        Page.ClientScript.RegisterArrayDeclaration("Skills", "'C#'");
        Page.ClientScript.RegisterArrayDeclaration("Skills", "'VB.NET'");
        Page.ClientScript.RegisterArrayDeclaration("Skills", "'C'");
        Page.ClientScript.RegisterArrayDeclaration("Skills", "'C++'");
    }

Now, what above declaration does?  This is nothing but a declaration of a java script array like,

Var Skills = new Array('C#', 'VB.NET','C','C++');

These “Skills” array is now only a JavaScript array which is easily accessible by client side code. Now Let’s have a look how to access them and how to bind them in a dropdown list.

CSS Friendly Menu Control in ASP.NET 4.0


It is very much easier to apply CSS when we have ul,li elements as the HTML content. If we look into ASP.NET Menu Control till Version 3.5, its render as Table-TR-TD Tag. Though Table/Tr/Td is quite useful to display tabular data but sometime  creates  a big problem when we need to do more work with CSS. To overcome this problem we generally used CSS Friendly adapter to render the ASP.NET Control in ul/li mode.

ASP.NET 4.0 makes the things easier for web developer by providing “RenderingMode” properties. Here we can specify RenderMode of a ASP.NET Menu control. Which define the what will be the HTML Render Content Type. Bydefault mode is “List” which means control will be render as ul/li

As per the above diagram we can see that there are three mode available. We can use any one of them as per the requirement.

ViewState Control in ASP.NET 4.0


View State is one of the most important and useful client side state management mechanisms. It can store the page value at the time of post back (Sending and Receiving information from Server) of your page. ASP.NET pages provide the View State property as a built-in structure for automatically storing values between multiple requests for the same page.

we generally used “EnableViewState” Properties for both Page Level and Server Control Level to maintain the view state. Till ASP.NET 3.5 Version, Page Level view state control treat as highest priorities. Which means If we set EnableViewState= “False” in page level that will automatically derived by all the server side control. In that case if we set “EnableViewState=”True”” for any server side control will treat as false, as we have defined them “False” in Page Level.Here is one complete article on ASP.NET 2.0/3.5 View State , which may helpful for you

Now, let’s have a look into the changes in ViewState Control in ASP.NET 4.0. There is a massive change in View State Control in ASP.NET 4.0 which is very much helpful for developer also. Asp.net 4.0 added a new property to Page object and server controls called ViewStateMode.

IntelliTrace Debugging – Video Demo

Recently I have published one complete tutorial on Visual Studio 2010 Debugging. Which covered almost all main features of debugging in Visual Studio 2010 like Basic of Breakpoints,  breakpoint labeling, data tips, multithreaded debugging, and parallel debugging and IntelliTrace debugging. You can read the complete article from My Blog or from CodeProject.

While preparing the article I had created one small video on IntelliTrace Debugging which will show you the demo of using IntelliTrace Debugging.  Hope you will enjoy this video.

kick it on DotNetKicks.com

MVP (Most Valuable Professional) 2010 – Code Project

I have recognized by MVP (Most Valuable Professional) by Code Project again for the year 2010. This is second time I have been awarded with MVP. I have received MVP because of Contribution to the Code Project Forum over the year 2009.
I would like to congratulate all the MVP Winners 2010.
I would like to thank all my readers, friends and well wishers and thanks to Chirs Maunder(Co- Founder of Code Project), Sacha Barber , Rajesh R Subramanian , Christian Graus , Abhishek Sur and all CP Members

Beginners Guide’s to ASP.NET MVC Framework – Part 1 of n


This article describes overview of ASP.NET MVC Framework , MVC Control Flow etc.

This article is the Part 1 of the ASP.NET MVC Framework series.  In this article I have describes very basic over view of MVC Framework and the control flow of MVC. I will write a few articles in this series which will help all the beginners to move ahead. This article is only about what MVC is.

Overview

The Model-View-Controller (MVC) design pattern is an architectural design patterns for any standard development that separates the components of an application. This allows application to handle very flexible and extensible and easy to handle. ASP.NET MVC Framework is also one of the standard web development frameworks which separate the components of web development application different components.

ASP.NET MVC Framework having three main components

  1. Model
  2. View
  3. Controller

4

Model: The model manages the behavior and data of the application domain, responds to requests for information about its state from the view, and responds to instructions to change state (usually from the controller).

View: This represent the presentation layer of the web application. The view manages the display of information based on the data of model that is requested by controller.

Controller: Controller handles the user interaction with the web application.  User request comes through controller to model and manipulate the records from it and then render the data using View to UI.

Below diagram showing the overview of these three components

1

Request Flow for ASP.NET MVC Framework

  1. Request comes from User to Controller
  2. Controller processes request and forms a data Model
  3. Model is passed to View
  4. View transforms Model into appropriate output format
  5. Response is rendered to Browser

2

Above picture showing you the actual flow of ASP.NET MVP Framework.  Request comes from client to Controller and controller decided which model to used and based on that data rendered into browser.

Now, just have a closer look into to the MVC Flow,

3

In the next article I will give the explanation of each of every step. You just need to remember these are the basic flow of an MVC Application.

ASP.NET Web Forms and  MVC

MVC is not a replacement if ASP.NET Web Form based development. This seats on the top of ASP.NET Development.  MVC Framework simply divides the overall application architecture into three components.

For More information on the basic of MVC Framework please read :
ASP.NET MVC Overview (C#)

Summary

This is the startup article for MVC beginners. Many more to come. Where I will explain details of each of them with sample application. Finally there would be a complete ASP.NET project on MVC Framework. Hope this series will be helpful for all.