Sunday, November 18, 2012

Asp.net development server failed to start listening on port

Recently, I am working on Visual Studio 2010. It was working fine but one morning i get a message 

"Asp.net development server failed to start listening on port 1478.
Error Message: only one usage of each socket address is normally permitted ."


Go to the Solution Explorer in Visual Studio --> then click on the web site application--> press F4 or go application’s property window.  set "Use Dynamic Port" to "False". Also set the port number instead of previous port number.

Happy Programing :)

Thursday, November 15, 2012

New features in ASP.NET 4.0 and Visual Studio 2010

Code Snippets:
Code snippets are pre-developed code templates which can save time spent on thinking about the syntax. VS2010 are introduced for JScript, HTML, and ASP.NET markup as well.
Press CTRL+K, CTRL+X.
Inside the script tag, it would be

And inside the HTML:


Generate From Usage

In previous versions of ASP.NET, Microsoft introduced code refactoring to generate methods and identifiers from existing code. In ASP.NET 4.0, there is a new concept of Generate From Usage - generates properties, methods, classes, and other types based on existing code.
Write some code, select it and right click on the left most character, and you will get options to change it to a property or method etc. This option is shown only if you do not define an identifier. For example, in the following example intellisense, it will not show the options to extract a property if you right click on the variable i.

Tuesday, November 13, 2012

How to embed video file into asp.net?

This article demonstrates how to play an swf file (flash) in asp.net. I have used flash file & .wmv file to play in asp.net website.
For Flash file:
Put this code in your aspx file.












For wmv file:

                
                
                
                
                
                
                
                
                
                
                
                
            
Also change this line: give your file path
 

Happy Codding :)