Bonjour tout le monde je galère juste pour afficher ma fenêtre pop-up au démarrage d'une page Jai suivit un tuto a la lettre mais j'arrive toujours pas à afficher ma fenêtre
Je pars a partir du lay-out (voir contenu)
[code=asp.net]
<!DOCTYPE html >
<html lang = "fr" >
<head>
<meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" />
<meta charset = "utf-8" />
<title> @ViewBag.Title - Mon application ASP.NET MVC</title>
<link href = "~/favicon.ico" rel = "shortcut icon" type = "image/x-icon" />
<meta name = "viewport" content = "width=device-width" />
@Styles.Render("~/Content/css")
<link href = "~/Content/themes/base/jquery-ui.css" rel = "stylesheet" />
@Scripts.Render("~/bundles/jquery")
<script src = "~/Scripts/jquery-ui-1.8.24.min.js" ></script>
@Scripts.Render("~/bundles/modernizr")
<script type = "text/javascript" >
$(document).ready(function () {
alert('ok');
$("#dialog-modal").dialog({
height: 355,
width: 400,
show: { effect: 'drop', direction: "up" },
modal: true
});
});
</script>
</head>
<body>
<header>
<div class = "content-wrapper" >
<div class = "float-left" >
<p class = "site-title" > @Html.ActionLink("votre logo ici", "Index", "Home")</p>
</div>
<div class = "float-right" >
<section id = "login" >
@Html.Partial("_LoginPartial")
</section>
<nav>
<ul id = "menu" >
<li> @Html.ActionLink("Accueil", "Index", "Home")</li>
<li> @Html.ActionLink("À propos de", "About", "Home")</li>
<li> @Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>
</nav>
</div>
</div>
</header>
<div id = "body" >
@RenderSection("featured", required: false)
<section class = "content-wrapper main-content clear-fix" >
@RenderBody()
</section>
</div>
<footer>
<div class = "content-wrapper" >
<div class = "float-left" >
<p> © @DateTime.Now.Year - Mon application ASP.NET MVC</p>
</div>
</div>
</footer>
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
</body>
</html>
[/code]
voici ma vue(elle affiche juste la liste des produit)
[code=asp.net]
@model IEnumerable<MvcAjaxPOP.Models.customer>
@{
ViewBag.Title = "ListCustomer";
//Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id = "dialog-modal" title = "le title du dialog" >
<p> this is a test popu</p>
</div>
<h2> ListCustomer</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table>
<tr>
<th>
@Html.DisplayNameFor(model => model.c_name)
</th>
<th>
@Html.DisplayNameFor(model => model.c_address)
</th>
<th>
@Html.DisplayNameFor(model => model.c_mobile)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.c_name)
</td>
<td>
@Html.DisplayFor(modelItem => item.c_address)
</td>
<td>
@Html.DisplayFor(modelItem => item.c_mobile)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.c_id }) |
@Html.ActionLink("Details", "Details", new { id=item.c_id }) |
@Html.ActionLink("Delete", "Delete", new { id=item.c_id })
</td>
</tr>
}
</table>
[/code]
pour finir voici le controleur
[ code]
public ActionResult ListCustomer ()
{
MvcAjaxPOP. Models. DataClasses1DataContext dc = new Models. DataClasses1DataContext ();
return View ( dc. customer. ToList ());
}
[/ code]
lorsque je fait une alerte je vois tres bien le message au chargement de la page (c'est bizzard qu'il ne charge pas mon pop-up)du genre
[code=asp.net]
<script type = "texte/JavaScript" >
$(document).ready(function () {
alert("ok");
$("#dialog-modal").dialog({
height: 355,
width: 400,
show: { effect: 'drop', direction: "up" },
modal: true
});
});
</script>
[/code]
NB : tous les fichiers appelés dans le lay-out sont belle et bien dans leur emplacement
Merci une aide sera la bienvenue
Afficher la suite