2013-12-16 151 views
0

我想執行一個jquery函數,但它給了我一個錯誤,我不知道發生了什麼。這真的是在給我打賭。我不知道我還能做什麼。0x800a139e - SyntaxError - Telerik RadGrid

如果有人知道如何解決它,請幫助我。

錯誤: 例外是在5263線拋出,列7本地主機:8538 /腳本/ jQuery的1.8.2.js 0x800a139e - JavaScript的運行時錯誤:的SyntaxError

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> 

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent"> 
    <script src="Script/jquery-1.8.2.js"></script> 
    <script> 

     $(document).ready(function() { 
      setpager(); 
     }); 

     function setpager() { 
      $("#grdTeste .rgPagerCell:first").find('div').not(".rgInfoPart").css('display', 'none'); 
      $("#grdTeste .rgPagerCell:last").find('.rgInfoPart').css('display', 'none'); 
     } 
    </script> 
    <section class="featured"> 
     <div class="content-wrapper"> 
      <hgroup class="title"> 
       <h1><%: Title %></h1> 
      </hgroup> 
     </div> 
    </section> 
    <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"> 

       <tbody> 
        <tr> 
         <td width="50%" valign="bottom" height="25"> 
           <font id="tituloTela" style="padding-left:6px"> Feriados </font> 
          <input id="Button1" type="button" value="button" onclick="setpager();"/> 
         </td> 
        </tr> 
       </tbody> 
    </table> 
    </asp:Content> 
    <asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent"> 
    <telerik:RadGrid ID="grdTeste" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True" AllowSorting="True" CellSpacing="0" 
    DataSourceID="SqlDataSource" GridLines="None" PageSize="5" OnNeedDataSource="RadGrid1_NeedDataSource" > 
     <ExportSettings> 
      <Pdf PageWidth=""> 
      </Pdf> 

     </ExportSettings> 
     <MasterTableView AutoGenerateColumns="False" DataKeyNames="COD_FERIADO" DataSourceID="SqlDataSource" CommandItemDisplay="Top" > 
      <CommandItemSettings AddNewRecordText="Adicionar Novo Registro" RefreshText="Atualizar"/> 
      <Columns> 
       <telerik:GridBoundColumn DataField="DATA" FilterControlAltText="Filter DATA column" HeaderText="DATA" SortExpression="DATA" UniqueName="DATA"> 
       </telerik:GridBoundColumn> 
       <telerik:GridBoundColumn DataField="NOME" FilterControlAltText="Filter NOME column" HeaderText="NOME" SortExpression="NOME" UniqueName="NOME"> 
       </telerik:GridBoundColumn> 
       <telerik:GridBoundColumn DataField="COD_FERIADO" DataType="System.Int32" FilterControlAltText="Filter COD_FERIADO column" HeaderText="COD_FERIADO" ReadOnly="True" SortExpression="COD_FERIADO" UniqueName="COD_FERIADO"> 
       </telerik:GridBoundColumn> 
      </Columns> 
      <EditFormSettings> 
       <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn> 
      </EditFormSettings> 
     </MasterTableView> 
     <PagerStyle Position="TopAndBottom" AlwaysVisible="true"/> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:StringConexao %>" 
     DeleteCommand="DELETE FROM feriados WHERE (COD_FERIADO = @COD_FERIADO)" 
     SelectCommand="SELECT DATA, NOME, COD_FERIADO FROM feriados" 
     UpdateCommand="UPDATE feriados SET NOME = @NOME, DATA = @DATA WHERE (COD_FERIADO = @COD_FERIADO)" 
     InsertCommand="INSERT INTO feriados VALUES (NEXT VALUE FOR SEQ_FERIADO_NOVA, @DATA, @NOME)"> 
     <DeleteParameters> 
      <asp:Parameter Name="COD_FERIADO" /> 
     </DeleteParameters> 
     <InsertParameters> 
      <asp:Parameter Name="DATA" /> 
      <asp:Parameter Name="NOME" /> 
     </InsertParameters> 
     <UpdateParameters> 
      <asp:Parameter Name="NOME" /> 
      <asp:Parameter Name="DATA" /> 
      <asp:Parameter Name="COD_FERIADO" /> 
     </UpdateParameters> 
    </asp:SqlDataSource> 
</asp:Content> 
+0

其中是UR使用id =「grdT控制este「和class =」rgPagerCell「 –

+0

現在代碼是正確的,對不起 – user3107374

回答

0

這個錯誤是因爲你的正在使用普通的javascript來查找radgrid(telerik控件)。

用於Telerik的contols的JavaScript是比HTML contols正常的JavaScript不同:

要與id="grdTeste"找到radgrid控件:

var grdTeste=$find("<%=grdTeste.ClientID%>"); //find radgrid 

這將幫助你與radgrid控件在客戶端的工作:

Working with Radgrid on client side