使用Javascript的ASP .NET Gridview分页问题

时间:2011-06-13 18:59:44

标签: javascript jquery asp.net vb.net gridview

单击ASP .NET gridview中的页码时遇到问题。当我点击另一个页码时,我被重定向到我项目中另一个不相关的页面。

在我将jQuery添加到我的母版页之前,这不是问题,因此我猜测javascript代码中存在某种冲突。当上述重定向发生时,页面PageIndexChanging事件不会被触发,并且据我所知,没有回发。

有没有其他人遇到这个?一些代码如下:

<head runat="server">
<title>Vinformative</title>
<link href="style2.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/favicon.ico" rel="shortcut icon" />
<meta property="og:title" content="Vinformative" />
<meta property="og:type" content="company" />
<meta property="og:url" content="http://www.vinformative.com" />
<meta property="og:image" content="http://www.vinformative.com/imgs/WEBLogoReverse480x186.png" />
<meta property="og:site_name" content="Vinformative" />
<meta property="fb:admins" content="6990" />

<script type="text/javascript" src='<%= ResolveUrl("~/js/jquery-1.4.2.min.js") %>'></script>
<script type="text/javascript" src='<%= ResolveUrl("~/js/jquery.tabSlideOut.v1.3.js") %>'></script>

<script type="text/javascript">
    var directory_root = 'http://localhost:1485/Vinformative.com/'
    $(function() {
        $('.slide-out-div').tabSlideOut({
            tabHandle: '.handle',                     //class of the element that will become your tab
            pathToTabImage: directory_root + 'imgs/handle.gif', //path to the image for the tab //Optionally can be set using css
            imageHeight: '122px',                     //height of tab image           //Optionally can be set using css
            imageWidth: '40px',                       //width of tab image            //Optionally can be set using css
            tabLocation: 'left',                      //side of screen where tab lives, top, right, bottom, or left
            speed: 300,                               //speed of animation
            action: 'click',                          //options: 'click' or 'hover', action to trigger animation
            topPos: '200px',                          //position from the top/ use if tabLocation is left or right
            leftPos: '20px',                          //position from left/ use if tabLocation is bottom or top
            fixedPosition: false                      //options: true makes it stick(fixed position) on scroll
        });
        $('#content').load(directory_root + 'winesearch.aspx');
    });


</script>



<style type="text/css" media="screen">
    .slide-out-div
    {
        padding: 20px;
        width: 400px;
        height: 310px;
        background: #f2f2f2;
        border: #29216d 2px solid;

    }
</style>


<asp:ContentPlaceHolder ID="head" runat="server">


</asp:ContentPlaceHolder>

                          我的文化             葡萄酒搜索             上传内容             添加一个酒             大车             轮廓             注销

        <%--anonymous users--%>
        <asp:HyperLink runat="server" ID="lnkWhoWeare" NavigateUrl="~/WhoWeAre.aspx">What is Vinformative?</asp:HyperLink>
        <asp:HyperLink runat="server" ID="lnkWhatWeDo" NavigateUrl="~/WhatWeDo.aspx">What We Do</asp:HyperLink>
        <asp:HyperLink runat="server" ID="lnkLogin" NavigateUrl="~/Login.aspx">Login</asp:HyperLink>
        <asp:HyperLink runat="server" ID="lnkNews" NavigateUrl="~/News.aspx">News</asp:HyperLink>
        <asp:HyperLink runat="server" ID="lnkAbout" NavigateUrl="~/AboutUs.aspx">About Us</asp:HyperLink>

    </div>
    <%--end header links--%>
    <br />
    <br />

    <div align="center">
        <asp:Image ID="imgLogo" runat="server" AlternateText="logo" ImageUrl="~/imgs/WEBLogoReverse480x186.png" Width="480px" Height="186px" style="" Visible="false" />
    </div>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
    <div id="footer">
        <asp:HyperLink runat="server" ID="lnkWho2" NavigateUrl="~/WhoWeAre.aspx" Visible="false">What is Vinformative?</asp:HyperLink>
        <asp:HyperLink runat="server" ID="lnkWhat2" NavigateUrl="~/WhatWeDo.aspx" Visible="false">What We Do</asp:HyperLink>
        <asp:HyperLink runat="server" NavigateUrl="~/TOU.aspx#TOU" ID="lnkTOU">Terms of Use</asp:HyperLink>
        <asp:HyperLink runat="server" NavigateUrl="~/TOU.aspx#Privacy" ID="lnkPrivacyPolicy">Privacy Policy</asp:HyperLink>
        <asp:HyperLink runat="server" NavigateUrl="~/News.aspx" ID="lnkNews2" Visible="false">News</asp:HyperLink>
        <asp:HyperLink runat="server" NavigateUrl="~/AboutUs.aspx" ID="lnkAbout2" Visible="false">About Us</asp:HyperLink>
        <asp:HyperLink runat="server" NavigateUrl="mailto:info@vinformative.com" ID="lnkContact">Contact</asp:HyperLink>
        <br />

        <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>

        <fb:like href="http://www.facebook.com/pages/Vinformative/196975033650925" layout="button_count"
            show_faces="false" colorscheme="dark"></fb:like>
        <a target="_blank" href="http://www.twitter.com/Vinformative">
            <img style="display: inline; position: relative; top: -2px" src="http://twitter-badges.s3.amazonaws.com/t_mini-b.png"
                alt="Follow Vinformative on Twitter" border="0" width="18" height="18" valign="middle" /></a>
        &nbsp; Copyright © 2011 Vinformative, Inc. All rights reserved.
    </div>
    <!-- end #footer -->
</div>


<div class="slide-out-div">
    <a class="handle" href="http://link-for-non-js-users">Content</a>

    <div id="content">


    </div>
</div>

1 个答案:

答案 0 :(得分:0)

您可能需要使用jQuery.noConflict()设置。基本上jQuery和内存中使用的$令牌也会在ATLAS ajax脚本中被删除。尝试添加jQuery.noConflict()修复程序(docs http://api.jquery.com/jQuery.noConflict/

此外,这可能表示旧版本......