May

23

Using jQuery dialog in an MVC4 Mobile App

Posted by 4 Comments

According the jQuery Mobile Documentation for dialogs, you would open the dialog by adding

data-rel="dialog"

to the link. However, in an MVC4 Mobile app you need to add data_rel (note the ‘_’ not ‘-‘) to your actionlink like so:

@Html.ActionLink("Log in", "Login", "Account", routeValues: null, 
  htmlAttributes: new { data_icon = "gear", data_rel = "dialog" })


The same also applies to other attributes such as transitions:

@Html.ActionLink("Log in", "Login", "Account", routeValues: null, 
  htmlAttributes: new { data_icon = "gear", data_rel = "dialog", 
  data_transition = "flip" })

Category: .NET, Development, MVC4

Comments (4)

Trackback URL | Comments RSS Feed

  1. dotnetjohn says:

    thanks, wondering why I couldnt get this to work

  2. ano says:

    Im guessing this is a solution for MVC 4 RC?

  3. Jose says:

    Thank you so much for this artlice, it saved me time!

Leave a Reply