What’s New in ASP.NET MVC 4 (Version: 1.2.0)

Description

ASP.NET MVC 4 puts its focus on making it easier to develop mobile web applications. In this hands-on lab, you will start with the MVC 4 Internet Application project template and create a Photo Gallery application. You will progressively enhance the application using jQuery Mobile together with MVC 4 new features, to make it work great across different mobile devices and desktop web browsers. You will also learn about new code recipes for code generation and how MVC 4 makes it easier to write asynchronous action methods by supporting ActionResult return types.

Contents

Source:Β http://msdn.microsoft.com/en-us/vs11trainingcourse_aspnetmvc4#_Toc319061787

Resolve: Origin is not allowed by Access-Control-Allow-Origin

This was the first q/a that popped up for me when trying to solve the same problem using .net MVC as the source of my data. I realize this doesn’t solve the php question but it is related enough to be valuable.

I am using .net mvc. The blog post fromΒ Greg BrantΒ worked for me. Ultimately you create an attribute :

[HttpHeaderAttribute("Access-Control-Allow-Origin", "*")]

That you are able to add to controller actions.

eg:

public class HttpHeaderAttribute : ActionFilterAttribute
{
   public string Name { get; set; }
   public string Value { get; set; }
   public HttpHeaderAttribute(string name, string value)
   {
      Name = name;
      Value = value;
   }

   public override void OnResultExecuted(ResultExecutedContext filterContext)
   {
      filterContext.HttpContext.Response.AppendHeader(Name, Value);
      base.OnResultExecuted(filterContext);
   }
}

and then using it with:

[HttpHeaderAttribute("Access-Control-Allow-Origin", "*")]
public ActionResult MyVeryAvailableAction(string id)
{
    return Json( "Some public result" );
}

Source: http://goo.gl/WBsnr

Other view of the problem in…

ActionLink htmlAttributes “data-“

The problem is that your anonymous object property data-icon has an invalid name. C# properties cannot have dashes in their names. There are two ways you can get around that:

Use an underscore instead of dash (MVC will automatically replace the underscore with a dash in the emitted HTML):

@Html.ActionLink("Edit","edit","markets",new{ id =1},new{@class="ui-btn-right", data_icon="gear"})
Β 

Use the overload that takes in a dictionary:

@Html.ActionLink("Edit", "edit", "markets",
      new { id = 1 },
      new Dictionary<string, object> { { "class", "ui-btn-right" }, { "data-icon", "gear" } });

source: http://stackoverflow.com/questions/4108943/actionlink-htmlattributes

jQuery – Browser Support and Microsoft Ajax Content Delivery Network

Browser Support


Current Active Support
Internet Explorer Chrome Firefox Safari Opera
jQuery 1.x 6+ Current βˆ’ 1 version Current βˆ’ 1 version Current βˆ’ 1 version Current βˆ’ 1 version
jQuery 2.x 9+

Any problem with jQuery in the above browsers should be considered and reported as a bug in jQuery.

Current – 1 version denotes that we support the current stable version of the browser and the version that preceded it. For example, if the current version of a browser is 24.x, we support the 24.x and 23.x versions.

Source: http://jquery.com/browser-support/

——————–

Microsoft Ajax Content Delivery Network

The Microsoft Ajax Content Delivery Network (CDN) hosts popular third party JavaScript libraries such as jQuery and enables you to easily add them to your Web applications. For example, you can start using jQuery which is hosted on this CDN simply by adding a <script> tag to your page that points to ajax.aspnetcdn.com.

By taking advantage of the CDN, you can significantly improve the performance of your Ajax applications. The contents of the CDN are cached on servers located around the world. In addition, the CDN enables browsers to reuse cached third party JavaScript files for web sites that are located in different domains.

The CDN supports SSL (HTTPS) in case you need to serve a web page using the Secure Sockets Layer.

The CDN hosts the following third party script libraries which have been uploaded, and are licensed to you, by the owners of those libraries:

  • jQuery (www.jquery.com)
  • jQuery UI (www.jqueryui.com)
  • jQuery Mobile (www.jquerymobile.com)
  • jQuery Validation (www.jquery.com)
  • jQuery Cycle (www.malsup.com/jquery/cycle/)
  • jQuery DataTables (http://datatables.net/)
  • Ajax Control Toolkit (owned by the Outercurve Foundation – http://www.outercurve.org)

The Microsoft Ajax CDN also includes the following libraries which have been uploaded by Microsoft:

  • ASP.NET Ajax
  • ASP.NET MVC JavaScript Files
  • ASP.NET SignalR JavaScript Files

Microsoft does not claim ownership of any third-party libraries hosted on this CDN. The copyright owners of the libraries are licensing these libraries to you. Any rights that you may have to download and use such libraries are granted solely by the respective copyright owners. Because these are not Microsoft libraries, Microsoft provides no warranties or intellectual property rights licenses (including no implied patent rights) for the third party libraries hosted on this CDN.

If you wish to submit your JavaScript library and your library is one of the top JavaScript libraries (as listed on http://trends.builtwith.com) or extensions/plugins to these libraries that are (a) popular; or (b) helpful for use on ASP.NET then please contact AjaxCDNSubmission@Microsoft.com.

Source: http://www.asp.net/ajaxlibrary/cdn.ashx