【发布时间】:2009-10-19 09:58:44
【问题描述】:
我的 ASP.NET 常规页面中有以下 jquery
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Color Items</title>
<script src="http://code.jquery.com/jquery-latest.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$("select option:even").addClass('evenColor');
});
</script>
<style type="text/css">
.evenColor
{
background-color:Gray;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="Gori"></asp:ListItem>
<asp:ListItem Text="Muf"></asp:ListItem>
<asp:ListItem Text="Lizo"></asp:ListItem>
</asp:DropDownList>
</div>
</form>
</body>
</html>
现在我想将其转换为母版页。我无法弄清楚将添加到母版页的内容以及添加到内容页的内容。脚本会转到 MasterPage 吗?
请注意:我有很多这样的常规 asp.net 页面,其中包含单独的 jquery 文件。我是否必须将所有这些 jquery 文件添加到一个母版页中。
正确的方法是什么?
【问题讨论】:
标签: javascript jquery html asp.net .net