![]() That first line checks if it's a mobile device making the request. ![]() Note the nullable ? as it has to work for both Create and Delete (int rating in Enum.GetValues(typeof(Rating))) ) I'd like this to be more generic, but here's what I did for the Rating editor Template. I could change this at some future point to be fancier and not even use a DropDown.Īside: How do you guys usually handle Enums? I've seen it done a few ways. Instead, I'll create a Rating.cshtml that makes a dropdown. I could have used DropDownList I suppose, but I have always found that helper confusing. Unfortunately scaffolding doesn't do Enums (I'm sad) for my Movie Ratings so I add EditorFor() calls to my Create and Edits, and update my Index. Next, I scaffold out the Index, Create, Edit, Delete, etc. Quick CRUD Exampleįirst, a model for DVDs. You can get a 7 day trial or you can get the Lite version of the Electric Plum Mobile Simulator with WebMatrix 2. I'll be using the Electric Mobile Studio from Electric Plum to simulate an iPhone. We will do a small site in ASP.NET MVC for the Desktop, do some quick DB access, add jQuery Mobile and a View Switcher switch back and forth. Let's make one that switches between both. One gets you a standard desktop site - although with responsive design elements so it works on small screens - and the other gets you a jQuery Mobile application meant primarily for phones and tablets. When you start Visual Studio 2012 and go File | New ASP.NET MVC 4 app, there's an Internet Application template and a Mobile template. ![]() (There's video of those ASP.NET mobile presentations available) However, some folks had asked me if I'd do a post on how to do a combination Desktop and Mobile site using ASP.NET MVC similar to the examples I used in my talks in Russia on mobile earlier this year. I've talked about the importance of a good mobile site before in posts like Create a great mobile experience for your website today. I actually got this blog looking nice on mobile devices back in 2006 when nobody was mobile except doctors and, well, all of us techies here on the blogs. There's something about making an experience great on a pocket supercomputer phone that is so much more satisfying than a desktop. I really enjoy working on and thinking about mobile websites. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |