Monday, July 25, 2011

Hello World application with ASP.NET pages and WebMatrix

In this post I am going to explain how we can create fast web sites without worrying about code and other stuff. Microsoft has introduced a new web development tools called ‘WebMatrix’. It’s a free tool provided by Microsoft to create website fast.

What is WebMatrix?

Web Matrix is a free tool provided by Microsoft for website development. You can develop websites lightening fast with the help of Microsoft Web Matrix. It includes IIS express(express version of IIS) and SQL Server Compact (Compact edition of SQL Server database). It also contains lots of popular web application templates like wordpress ,blogengine etc. You can also create dynamic web pages with WebMatrix. Here is the link from where you can download WebMatrix.

http://go.microsoft.com/fwlink/?LinkID=205867

What is asp.net Pages?

 

ASP.NET pages are one of easiest way to create websites pages. You can use Razor and all other syntax to create webpages. You can write script tag to write dynamic code and you can also write HTML in same page.

Creating Hello World application with WebMatrix

 

Now let’s create a very basic Hello World application without writing any dynamic code. So let’s first open WebMatrix and it will show start up page like following.


WebMatrix

Here you will have four options My Sites, Site from Open Source Gallery, Sites from Template and Site from folder. I want to create a new site so I have clicked on Site from template. Once you click on that you will be presented to Site from template dialog where you have different options like Empty Site,Starter site,Bakery etc. like following.

EmptySite

As I want to create a very basic site so I have clicked Empty site.Once you click on empty site your site will be created and you will presented to following screen.

SiteStructure

Now its time to create new page for the site. So I have clicked File->New Pages and you will be presented to page dialog like following where different options are available like HTML,CSS,Jscript,CHTML etc.

CSHTML

I have selected CSHTML as I want to have my site dynamic so I have one page called default.cshtml and then I have written Hello world HTML like following.

<!DOCTYPE html>

<html lang="en">

   <head>

       <meta charset="utf-8" />

       <title></title>

   </head>

   <body>

       <h1>Hello World</h1>

   </body>

</html>

Now let's run site in browser and following is the output.

HelloWorld

That’s it. It’s so easy. In future post I am going to write some dynamic code using Microsoft Web Matrix.Hope you like it..Stay tuned for more.. Till than happy programming..

kick it on DotNetKicks.comShout it
Share:
Sunday, July 24, 2011

Visual Studio 2010 styles

I have been working with visual studio 2010 yesterday and I was searching some thing and same time I have found one great site for Visual Studio styles. http://studiostyl.es/ This site is cool and you can find lots of visual studio 2010 styles of your choice. Here is the screenshot of site.


Style

You can create your own color schemes for visual studio also. I have downloaded the first one(Son of Obsidian). It will be visual studio settings file.Once you downloaded you can import like following. GoTo Tools->Import and export settings in Visual Studio 2010. Once you click this It will import and export dialog like following.


ImportExportDialog

I have selected Import selected environment setting and clicked next on next screen you will have option to save your visual studio settings like following.

SaveYourSettings

Clicking on next you will have options for different visual studio 2010 Style like following.

ChooseStyle

Click on browse and select your downloaded style like following.

OpenStyle

Click on open and then you will represented to recent file options click next You will come to final settings wizard like following.

FinishStyle

Click on finish now our style is applied.Close the dialog and open your project and you can see new color scheme for your visual studio 2010 like following.

VisualStudio2010Style

That’s it. Hope you like it. Stay tuned for more..Till then happy programming..


kick it on DotNetKicks.comShout it
Share:
Friday, July 22, 2011

Box Selection in Visual Studio 2010

Every day I am discovering something new with Visual Studio 2010 and In this post I am again going to explain you new interesting feature of Visual Studio 2010. We all required to modify the code in bulk some time and there is a new features for Visual Studio 2010 which enables to made changes in multiple line at same time. Let’s take a simple example like following.


using System;

namespace Parallel
{
  class Program
  {
         private int a=10;
         private int b=10;
         private int c=10;

         static void Main(string[] args)
         {

         }  
  }
}

In above code I have three private variable a,b and c and now I want to make them protected. There is two way either I do manually one by one or I can do it with box selection and modify them together. It very easy to use this feature Press ALT+ SHIFT and draw box with help of mouse on the code which you need to modify like following.



SelectedBox

Now I want to make it protected so I started writing protected and it will modify all the line at same time like following.

ChangedCode

And now my code is like following.

using System;

namespace Parallel
{
  class Program
  {
         protected int a=10;
         protected int b=10;
         protected int c=10;

         static void Main(string[] args)
         {

         }  
  }
}

That's it. Hope you like it… Stay tuned for more…Till then Happy programming.




Shout itkick it on DotNetKicks.com
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews