Tag: How to

Url.Action in ASP.NET MVC

The Url.Action method in ASP.NET MVC allows the developers to generate the fully qualified URL to an action method. It is defined in the namespace System.Web.Mvc. The Url.Action generates only the URL unlike the Html.ActionLink. Url.Action in ASP.NET MVC Below is a code snippet of the View demonstrating the Url.Action

How to refer to the file in Windows Phone app using ms-appx ?

When using the Speech recognition , you might refer to the Voice Command Definition file within your project . Assuming that the file name is AbundantcodeGrammar.xml . you might refer to the file with the ms-appx as shown below. new Uri(“ms-appx:///AbundantcodeGrammar.xml”,UriKind.RelativeOrAbsolute); When referring to the file at runtime , there are times when you might receive an error 0x80070002 error – The system cannot find…

How to accept HTML Form Data in a ASP.NET Web API Action Method ?

There are times when you might want to create an endpoint in ASP.NET WebAPI that can handle the HTML form data posted as x-www-form-urlencoded. One of the options is to use the model binding concept.   In this case , the model should have the names of the keys that are passed in the HTTP request. The MediaFormatters are used to extract the data from…

How to Populate the DropDownList in ASP.NET MVC Razor View?

The DropDownList is one of the most useful controls that can be used in various scenarios that involves selecting the data from the list. The ASP.NET MVC Framework provides the Html.DropDownList and Html.DropDownListFor helper methods which can be used to create DropDownList. How to Populate DropDownList in ASP.NET MVC Razor View? Below is a sample source code demonstrating how to Populate DropDownList in ASP.NET MVC…

Which Events to use to Save the Transient State in Windows Phone 8?

It is necessary for the developers to save the transient and the persistent state of the app when the application goes to the deactivated status. Which Events to use to Save the Transient State in Windows Phone 8? The PhoneApplicationPage’s OnNavigatedFrom and OnNavigatedTo methods can be used to save the transient state in Windows Phone 8.

How to Sort Array Elements in Ascending Order in C#?

The Array class includes static method called Sort which can be used to sort the array in ascending order in C#. Array.Sort(<arry>); How to Sort Array Elements in Ascending Order in C#? Below is a sample code snippet demonstrating sorting of array elements in ascending order in C#.

Different Types of For Loops in F#

F# supports 3 different types of For Loops . These include For…to – This is  astandard for loop For .. In – This is similar to For Each in C# for…downto Different Types of For Loops in F# Below is a code snippet demonstrating the different For Loops in F#

How to send email in Windows Phone 8 Application Programatically using C#?

The Windows Phone 8 SDK provides the EmailComposeTask which can be used to send email in Windows Phone 8 Programatically. The EmailComposeTask launches the Email Compose screen which lets the user to verify the email content and tap on the “send” button to send email. How to send email in Windows Phone 8 Application Programatically using C#? Below is a sample code snippet that demonstrates…

How to Implement Multiple order by in LINQ using C#?

There are scenarios where one might want to implement multiple order by statements when using LINQ in C#. For example, you might want to sort the list of article by category and then by date. Below is a sample code snippet that demonstrates how to How to Implement Multiple order by in LINQ using C# ? How to Implement Multiple order by in LINQ using…

The Windows Phone Emulator wasn’t able to ensure the virtual machine was running

Today , I encountered the below error when trying to run my windows phone project after upgrading my system from Windows 8 to Windows 8.1 The Error Message was “The Windows Phone Emulator wasn’t able to ensure the virtual machine was running: Something happened while starting a virtual machine:”Emulator WVGA.<Name>” could not initialize(Virtual machine ID <ID>) Not enough memory in the system to start the…