[英]Weird Jquery UI dialog box on MVC 4 ASP .NET
所以我試圖顯示一個JQUERY UI對話框只是為了顯示一些東西,我在看了一些教程后,我最終得到了一個可以正常工作的東西,但是它很奇怪,因為它產生了一個奇怪的結果,我在做什么錯呢? 我是MVC 4和JQuery的新手。
這是即時通訊使用的代碼:
@{
ViewBag.Title = "Exito";
}
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<div id="message" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
@{
ViewBag.Title = "Hola, Escribiste: ";
}
<script type="text/javascript">
$('#message').dialog({
});
</script>
<hgroup class="title">
<h1>@ViewBag.Title</h1>
<h2>@ViewBag.Message</h2>
</hgroup>
<link rel="stylesheet" href="/resources/demos/style.css">
<script type="text/javascript">
var Texto = "Hola, Escribiste: " + '@(ViewBag.Message)';
var myLength = Texto.length;
document.write("La cantidad de caracteres en la oracion es de "+myLength+" (Incluyendo el 'hola, escribiste')");
</script>
任何想法?
好的,我解決了,該鏈接未正確指向CSS樣式。
它是
<link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
代替
<link rel="stylesheet" href="/resources/demos/style.css">
新手錯誤
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.