Using C# object in Javascript in ASP.NET MVC

  1. Using @Html.Raw():
    dosomething(‘@Html.Raw(Model.UrProperty)’);
  2. Using JavaScriptSerializer() in the model:

Continue reading

Advertisements

Fill drop down list based on selection of another drop down list in ASP.NET MVC

Model:

namespace MvcApplicationrazor.Models
{
    public class CountryModel
    {
        public List<State> StateModel { get; set; }
        public SelectList FilteredCity { get; set; }
    }
    public class State
    {
        public int Id { get; set; }
        public string StateName { get; set; }
    }
    public class City
    {
        public int Id { get; set; }
        public int StateId { get; set; }
        public string CityName { get; set; }
    }
}   

Continue reading

ASP.NET MVC 4 includes ASP.NET Web API, a new framework for creating HTTP services that can reach a broad range of clients including browsers and mobile devices. ASP.NET Web API is also an ideal platform for building RESTful services.

ASP.NET Web API includes support for the following features: Continue reading

Asp.Net MVC introduction

Asp.Net MVC is an architecture to develop ASP.Net web applications in a different manner. Web applications developed with ASP.Net MVC are even more SEO (Search Engine) friendly. MVC is a standard design pattern some types of Web application will benefit from the MVC framework. Continue reading

AngularJS & Kendo UI using Angular Kendo with ASP.NET MVC 5, Web API & OData

A nice post on AngularJS and ASP.NET MVC

Long Le's Blog

Update: 5/1/2014 – Customer View & customerController.js has been updated to toggle styles by manipulating the DOM through the ViewModel with ng-show to adhere and stay consistent with AngularJS best practices.

Update: 5/14/2014 – Added section “Animating our View Swapping”, to elaborate on adding animation to the “ng-view” swapping process.

Source code: http://goo.gl/6Z9jop
Live demo: http://longle.azurewebsites.net

With AngularJS and ASP.NET MVC, we now have an MVC pattern and architecture for both on the client and server. What do we do and/or how do we approach this? Well one can argue we don’t use any of the MVC architecture on the server and build out a full-fledged AngularJS front-end application and only use make async calls to Web API for all things that absolutely need to be on the server e.g. CRUD, workflows, business logic, etc.

Now, there’s absolutely nothing wrong with this approach, and for the most part a lot…

View original post 1,530 more words