3

I have a Car View (List.cshtml) that shows my Car´s list... I´d like to add a button/link: "Add car..."

That button must open my View (Create.cshtml) in a JQuery Modal UI...

How can I do that?

Mathieu
  • 4,449
  • 7
  • 41
  • 60
Paul
  • 12,359
  • 20
  • 64
  • 101

1 Answers1

5

here you go:

demo: http://demo.aspnetawesome.com/Meals/Index

download it from here: http://awesome.codeplex.com

Create/Edit in jquery UI dialog (popup)

delete with confirm dialog (ui dialog)

the list is just a simple table with a foreach

Omu
  • 69,856
  • 92
  • 277
  • 407
  • Thanks Omu... I have one question, My Controllers are in a separated Project (from Views)... So, when I tried to add that: @Html.MakePopupForm(o => o.Create()) I got that error : CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments – Paul Nov 25 '10 at 11:51
  • 1
    @Paul I think that is because of cshtml, if you use you must do @(Html.Act(and so on)) – Omu Nov 25 '10 at 12:57
  • Solved... But now I got other error : The partial view '~\Views\Shared\Awesome\PopupForm.ascx' was not found. The following locations were searched: ~\Views\Shared\Awesome\PopupForm.ascx... But the PopupForm.ascx is in the right path... Any idea? – Paul Nov 25 '10 at 13:26
  • @Paul I've installed today the latest version of mvc3 and it works, the only difference for the razor is that I had to add the awesome namespaces in the views/web.config – Omu Nov 26 '10 at 09:39