Search This Blog

Monday, September 19, 2011

ASP.NET MVC 4 Developer Preview for Visual Studio 2010

Microsoft has released MVC 4 Developer Preview for Visual Studio 2010 and available to download from ASP.NET MVC 4 Developer Preview. ASP.NET MVC 4 can be installed and run with ASP.NET MVC 3 side-by-side.

Software Requirements:

1. .NET 4.o
2. Visual Studio 2010 SP1 or Visual Web Developer Express 2010

New features:

1. Enhanced ASP.NET MVC 4 project template allows you to create more modernized websites. The size of website is adjusted according to screen resolution.
2. Mobile project template - Develop web applications that can run on any phone. The MVC4 mobile template is based on JQuery Mobile framework.
3. Enhanced support for asynchronous methods.

Tuesday, September 6, 2011

HTML 5 Input Type - Number

HTML 5 Number Input type control allows user to increase or decrease the value of the textbox by clicking on up or down arrow buttons. As of today, only Chrome 13 and Safari 5 support this feature.


<!DOCTYPE html>
<html>
<head>     
    <title>Testing HTML 5 Number Input Type</title>
</head>
<body>
   <form>
        <label for="date">
            Please enter date:
            <input type="number" name="date" id="date"
                min="1" max="31" step="1" value="15">              
        </label>
    </form>
</body>
</html

Friday, September 2, 2011

Method Overloading in ASMX and WCF services

Both ASMX and WCF services do not support method overloading by default. However, it is possible to enable method overloading with ASMX or WCF service by decorating a ASMX web method or a WCF method as follows.

In ASMX:


[WebMethod (MessageName="HelloWorld")]

public string HelloWorld()
{
   return "HelloWorld";
}

[WebMethod (MessageName="HelloWorldWithName")]

public string HelloWorld(string name)
{
   return "HelloWorld " + name;
}

In WCF:


[ServiceContract]

public interface IMyCalculator
{
[OperationContract(Name="AddFloats")]
float Add(float operand1, float operand2);

[OperationContract(Name="AddIntegers")]

int Add(int operand1,int operand2);
}

Thursday, September 1, 2011