文档就绪功能在ASP.NET的内容页面中不起作用 [英] Document Ready Function not working in Content Pages of ASP.NET

查看:63
本文介绍了文档就绪功能在ASP.NET的内容页面中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我我的代码有什么问题。



这里,文档就绪功能不起作用。



Can anyone tell me what's wrong with my code.

Here,Document Ready function is not working.

<%@ Page Theme="SkinFile"  Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script src="Scripts/jquery-1.4.3.min.js" type="text/javascript">

        $(document).ready(function ()
        {
            $('#<%= GridView1.ClientID %> tbody tr').mouseover(function()
            {
                $(this).addClass('highlightRow');
            }).mouseout(function ()
            {
                $(this).removeClass('highlightRow');
            }).click(function ()
            {
                $(this).toggleClass('selectedRow');
            });

        }); 
        
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" BackColor="White"  Font-Size="10" Font-Names="Verdana" 
            BorderColor="#000000" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" 
            Width="400px" CellSpacing="0" GridLines="Horizontal" SkinID="gridviewSkin" >
        </asp:GridView>
</asp:Content>



先谢谢。


Thanks in Advance.

推荐答案

(文件) .ready(function()
{
(document).ready(function () {


('#<%= GridView1.ClientID%> tbody tr')。mouseover(function()
{
('#<%= GridView1.ClientID %> tbody tr').mouseover(function() {


(this).addClass('highlightRow');
})。mouseout(function()
{
(this).addClass('highlightRow'); }).mouseout(function () {


这篇关于文档就绪功能在ASP.NET的内容页面中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆