日期:2014-05-18  浏览次数:20381 次

母版页中应用JQuery的问题
HTML code

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Hysj.Master.cs" Inherits="Hysj_Web.Hysj" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>酒店管理</title>
    <link href="http://www.hysjw.cn/templets/style/print.css" rel="stylesheet" type="text/css" />
    <link href="Hysj_Css/left.css" rel="Stylesheet" type="text/css" />
    <link href="Hysj_Css/Hotel.css" rel="Stylesheet" type="text/css" />
    <link href="css/style1.css" rel="Stylesheet" type="text/css" />
    <script src="js/jquery-1.2.6.js" type="text/javascript"></script> 
    <script type="text/javascript">
    <!--
        $(document).ready(function() {
            $('ui.topmenu li').mouseover(function() {
                $(this).addClass("thisclass");
            }).mouseout(function() {
                $(this).removeClass("thisclass");
            });
        });
    //-->
   </script>
</head>
<body>
<div class="cat"><!-- 页面开始 -->

<div class="top cbody"><!-- 头部开始 -->
    <ul class="topmenu"><!-- 导航栏开始 -->
        <li><a href="#">首页</a></li>
        <li><a href="/zx">新闻</a></li>
        <li><a href="/cn">国内游</a></li>
        <li><a href="/ya">出境游</a></li>
        <li><a target="_self" href="../Hotel_Admin/HotelQuery.aspx">订酒店</a></li>
        <li><a target="_self" href="../Line/Line_index.aspx">订线路</a></li>
        <li><a href="/nm">订景点</a></li>
        <li><a target="_self" href="../Flyticket_Admin/FlyTicketIndex.aspx">订机票</a></li>
        <li><a href="/bbs">论坛</a></li>
    </ul><!-- 导航栏结束 -->

    <div class="tab_hot"></div>

</div><!-- 头部结束 -->

<form id="form1" runat="server">
  <div>
     <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">  
     </asp:ContentPlaceHolder>
  </div>
</form>
<div style="width:954px; height:5px; background-color:#fff9ec; margin:0 auto; font-size:0 "></div>
</div>
</body>
</html>



------解决方案--------------------
楼主,你和碰到了一样的问题。简单点说你要把JS,HTML代码放在<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">


例如<script src="js/jquery-1.2.6.js" type="text/javascript"></script> 
<script type="text/javascript">
<!--
$(document).ready(function() {
$('ui.topmenu li').mouseover(function() {
$(this).addClass("thisclass");
}).mouseout(function() {
$(this).removeClass("thisclass");
});
});
//-->
</script>

<div class="cat"><!-- 页面开始 -->

<div class="top cbody"><!-- 头部开始 -->
<ul class="topmenu"