Bonjour à tous.
J'ai des difficultés à afficher ma vue "Create" dans le ContentPage
voilà mon template
Au clic sur le menu
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Sufee Admin - HTML5 Admin Template</title> <meta name="description" content="Sufee Admin - HTML5 Admin Template"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="apple-touch-icon" href="apple-icon.png"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="vendors/bootstrap/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="vendors/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="vendors/themify-icons/css/themify-icons.css"> <link rel="stylesheet" href="vendors/flag-icon-css/css/flag-icon.min.css"> <link rel="stylesheet" href="vendors/selectFX/css/cs-skin-elastic.css"> <link rel="stylesheet" href="vendors/jqvmap/dist/jqvmap.min.css"> <link rel="stylesheet" href="assets/css/style.css"> <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'> </head> <body> <aside id="left-panel" class="left-panel"> <nav class="navbar navbar-expand-sm navbar-default"> <div class="navbar-header"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-menu" aria-controls="main-menu" aria-expanded="false" aria-label="Toggle navigation"> <i class="fa fa-bars"></i> </button> <a class="navbar-brand" href="./"><img src="images/logo.png" alt="Logo"></a> <a class="navbar-brand hidden" href="./"><img src="images/logo2.png" alt="Logo"></a> </div> <div id="main-menu" class="main-menu collapse navbar-collapse"> <ul class="nav navbar-nav"> <li class="active"> <a href="ConseilTechniques"> <i class="menu-icon fa fa-dashboard"></i>Conseil technique </a> </li> </ul> </div><!-- /.navbar-collapse --> </nav> </aside><!-- /#left-panel --> <div id="right-panel" class="right-panel"> <!-- Header--> <header id="header" class="header"> </header><!-- /header --> <!-- Header--> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>© @DateTime.Now.Year - Mon application ASP.NET</p> </footer> </div> </div><!-- /#right-panel --> <script src="vendors/jquery/dist/jquery.min.js"></script> <script src="vendors/popper.js/dist/umd/popper.min.js"></script> <script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script> <script src="assets/js/main.js"></script> <script src="vendors/chart.js/dist/Chart.bundle.min.js"></script> <script src="assets/js/dashboard.js"></script> <script src="assets/js/widgets.js"></script> <script src="vendors/jqvmap/dist/jquery.vmap.min.js"></script> <script src="vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script> <script src="vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script> <script> (function ($) { "use strict"; jQuery('#vmap').vectorMap({ map: 'world_en', backgroundColor: null, color: '#ffffff', hoverOpacity: 0.7, selectedColor: '#1de9b6', enableZoom: true, showTooltip: true, values: sample_data, scaleColors: ['#1de9b6', '#03a9f5'], normalizeFunction: 'polynomial' }); })(jQuery);</script> </body> </html>, l'index s'affiche proprement dans le ContentPage. C'est quand je veux afficher la vueConseil techniqueà partir de l'actionCreatedu code@Html.ActionLink("Create New", "Create")
qu'il y a problème. Cette vue s'affiche bien mais pas dans le ContentPage.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 @model IEnumerable<TAPELLO_MVC_Csharp.Models.ConseilTechniques> @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h2>index</h2> <p> @Html.ActionLink("Create New", "Create") </p> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.Valeur) </th> <th> @Html.DisplayNameFor(model => model.Libelle) </th> <th> @Html.DisplayNameFor(model => model.Supprime) </th> <th></th> </tr> @if ( Model != null ) { foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Valeur) </td> <td> @Html.DisplayFor(modelItem => item.Libelle) </td> <td> @Html.DisplayFor(modelItem => item.Supprime) </td> <td> @Html.ActionLink("Edit", "Edit", new { id = item.Id }) | @Html.ActionLink("Details", "Details", new { id = item.Id }) | @Html.ActionLink("Delete", "Delete", new { id = item.Id }) </td> </tr> } } </table>
Voici mon controller
Je vous remercie d'avance de me donner un coup de pouce
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace TAPELLO_MVC_Csharp.Controllers { public class ConseilTechniquesController : Controller { // GET: ConseilTechniques public ActionResult Index() { return View(); } // GET: ConseilTechniques/Details/5 public ActionResult Details(int id) { return View(); } // GET: ConseilTechniques/Create public ActionResult Create() { return View(); } // POST: ConseilTechniques/Create [HttpPost] public ActionResult Create(FormCollection collection) { try { // TODO: Add insert logic here return RedirectToAction("Index"); } catch { return View(); } } // GET: ConseilTechniques/Edit/5 public ActionResult Edit(int id) { return View(); } // POST: ConseilTechniques/Edit/5 [HttpPost] public ActionResult Edit(int id, FormCollection collection) { try { // TODO: Add update logic here return RedirectToAction("Index"); } catch { return View(); } } // GET: ConseilTechniques/Delete/5 public ActionResult Delete(int id) { return View(); } // POST: ConseilTechniques/Delete/5 [HttpPost] public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here return RedirectToAction("Index"); } catch { return View(); } } } }
Partager