Monday, September 30, 2013

Extract to User Control in visual studio11



In large projects, we are having large pages and its always good to use  user control(.ascx) but sometimes we are so lazy to create user controls and we remain with the whole page and even we can’t reuse that code. In similar kind of situation ‘Extract to user control’ can be quite useful. Suppose we have long HTML mark up and we need to convert one div to user control and then we can do it very easily with Visual Studio 11 beta Extract to User Control feature.

You just need to select code you want there in user control and then you need to right click and click ‘Extract to User Control’ like below.

Extract to user control feature- What's new in visual studio 11 features


And once you click on ‘Extract to User Control’ It will ask to save your user control with save dialog like following.

Extract to user control feature save dialog visual studio 11 feature series

Once you click ok a new user control will be like following.

Extarct to User control- Extracted user control in visual studio 11

And now your mark up in default.aspx page will look like following.

extract to user control visual studio 11 aspx page

Dark Visual Experience in Visual Studio 2012

 I found that there are two type of themes available in visual studio 2012 light and dark under Tools->Option-> General environment value. This is one of newest feature I have found in visual studio 2012.

Dark Visual Experience in Visual studio 2012- A new visual studio feature.

Once you switch to dark and click ok. It will look like completely dark like following.

Dark Visual Studio theme like blend - A Visual Studio 2012 feature

It totally look like Expression blend and even if you open project the editor font and everything looks like same as blend.



Color indication in Visual Studio 2012

Before some days Microsoft has released the release candidate version of Visual Studio 2012. Today I got installed Visual Studio 2012 and once I loaded the visual studio 2012 first things I noticed that there is purple color blank strip is there at bottom. After doing some R and D on internet I have found that it is used for the different indication. The purple color indicates that there is no project loaded now.


Color Indication in visual studio 2012 Purple color for no project


Once you open the project this line will be of blue color like below.

Blue color for project loading in visual studio 2012 color indication feature in visual studio 2012

Once you run and F5 and debug it, the color will change to orange like below
.
Orange color in Visual Studio 2012 Indicator indicate that it is in debug mode.

Isn’t that great? A simple color indicator for each mode in visual studio 2012. Stay tuned for the more. I am going to put some more post about Visual Studio 2012. Till then happy programing

Image preview in solution explorer Visual Studio 2011 beta

Everyday I am using Microsoft Visual Studio 2011 beta and everyday I learn some cool feature of it. In today’s post I am going to explain one cool features of Visual Studio 2011 beta solution explorer. As a web developer we all want to see the image preview in solution explorer and visual studio 2011 beta is now having it. We can see image preview in solution explorer just like following.


ImagePreviewSolutionExplorer

Event handler generation in Visual Studio 2012

There are lots of new features there in visual studio 2012. Event handler generation is one of them. In earlier version of visual studio there was no way to create event handler from source view directly.  Now visual studio 2012 have event handler generation functionality.

So if you are editing an event view in source view intellisense will display add new event handler template and once you click on it. It will create a new event handler in the cs file. It will also put a eventhandler name against event name so you don’t need to write that.

So, let’s take a simple example of button click event so once I write onclick attribute their smart intellisense will pop up
.
Event handler generation in visual studio 2012 - What's new in visual studio 2012

Now once you click on <Create New Event> It will create event handler in .cs file like following.


Event Handler in asp.net with visual studio 2012 - What's new in visual studio 2012

It will also put submitButton_Click on onClick attribute. 

Create event new handler in visual studio 2012 - new feature of visual studio 2012

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...