"The script /Sample1/ScriptResource.axd?... failed to load. Check for inaccessible path."

2 posts, 0 answers
  1. thecruciable
    thecruciable avatar
    8 posts
    Member since:
    Mar 2007

    Posted 24 Aug 2009 Link to this post

    Hi I have the following code works fine on my local machine but when deployed to test server I get the following error: "The script /Sample1/ScriptResource.axd?... failed to load. Check for inaccessible path." It acts weird it updates or cancels first time and second time I try and click it does not work and when refresh the page it starts working again but only for the one record and then I have to click the refresh button again to make it work, My boss told me that it is giving following error scriptresource.asd and that

    The JavaScript error is the root of the problem - once that is solved, the grid will behave as expected.

    .. Please help me
    ASPX Code:


    <telerik:RadGrid runat="server" ID="rgRegistered" GridLines="None"
                    AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="true" PageSize="30"
                    AutoGenerateColumns="false" ShowGroupPanel="false" ShowFooter="true" Width="1500" EnableAjaxSkinRendering="true"
                    OnNeedDataSource="rgRegistered_NeedDataSource"
                    OnItemDataBound="rgRegistered_ItemDataBound"
                    OnItemCommand="rgRegistered_ItemCommand">
                    <ValidationSettings EnableValidation="true" ValidationGroup="vgGrid" />
                    <MasterTableView DataKeyNames="GradID" EditMode="InPlace">
                        <Columns>
                            <telerik:GridBoundColumn HeaderText="GradID" DataField="GradID" SortExpression="GradID"
                                Visible="false" />
                            <telerik:GridEditCommandColumn ButtonType="LinkButton" EditText="Edit" CancelText="Cancel"
                                UpdateText="Update">
                            </telerik:GridEditCommandColumn>
                            <telerik:GridTemplateColumn HeaderText="Badge Name" SortExpression="BadgeName" ItemStyle-Wrap="false">
                                <EditItemTemplate>
                                    <asp:TextBox ID="tbxBadgeName" runat="server" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblBadgeName" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn HeaderText="Department" DataField="Department"
                                SortExpression="Department" ReadOnly="true" />
                            <telerik:GridBoundColumn HeaderText="Email" DataField="Email" SortExpression="Email"
                                ReadOnly="true" />
                            <telerik:GridTemplateColumn HeaderText="Phone" SortExpression="Phone" ReadOnly="true">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblPhone" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>                                               
                            <telerik:GridTemplateColumn HeaderText="Other" SortExpression="Other">
                                <EditItemTemplate>
                                    <asp:RadioButtonList runat="server" ID="rbtnlOther" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblOther" />
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:Label runat="server" ID="lblOtherTotals" />
                                </FooterTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Not Attending Conference" SortExpression="Rsvp">
                                <EditItemTemplate>
                                    <asp:RadioButtonList runat="server" ID="rbtnlRsvp" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblRsvp" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>

    C# Code:

    protected void rgRegistered_ItemDataBound(object source, GridItemEventArgs e)
            {
                if (e.Item is GridDataItem)
                {
                    GridDataItem gdiItem = (GridDataItem)e.Item;

                    if (gdiItem != null)
                    {
                        // bind different controls to the data from the collection based
                        // on whether or not the row in the grid is in edit mode.
                        if (!gdiItem.IsInEditMode) // view mode (Label controls)
                        {
                            ((Label) gdiItem.FindControl("lblBadgeName")).Text = DataBinder.Eval(gdiItem.DataItem, "BadgeName").ToString();                    
                         
                            ((Label) gdiItem.FindControl("lblOther")).Text = DataBinder.Eval(gdiItem.DataItem, "Other").ToString();
                            ((Label) gdiItem.FindControl("lblRsvp")).Text = DataBinder.Eval(gdiItem.DataItem, "Rsvp").ToString();

                            if (DataBinder.Eval(gdiItem.DataItem, "Phone") != null)
                            {
                                Regex regexNonnumeric = new Regex(@"[^0-9]");
                                string strNumeric = regexNonnumeric.Replace(DataBinder.Eval(gdiItem.DataItem, "Phone").ToString(), string.Empty);
                                ((Label)gdiItem.FindControl("lblPhone")).Text = Convert.ToInt64(strNumeric).ToString("(000)000-0000");
                            }
                            
                        }
                        else // edit mode (non label controls)
                        {
                            #region Declare Controls                 
                            RadioButtonList rbtnlOther = (RadioButtonList)gdiItem.FindControl("rbtnlOther");
                            RadioButtonList rbtnlRsvp = (RadioButtonList)gdiItem.FindControl("rbtnlRsvp");

                            #endregion

                            #region Bind Controls

                            ((TextBox)gdiItem.FindControl("tbxBadgeName")).Text = DataBinder.Eval(gdiItem.DataItem, "BadgeName").ToString().Trim();

                          
                            if (rbtnlOther != null)
                            {
                                // now populate the radio button list
                                AppCode.ControlLibrary.BindMethod.rbtnlYesNoBind(rbtnlOther);
                                rbtnlOther.SelectedValue = DataBinder.Eval(gdiItem.DataItem, "Other").ToString();
                            }
                            if (rbtnlRsvp != null)
                            {
                                // now populate the radio button list
                                AppCode.ControlLibrary.BindMethod.rbtnlYesNoBind(rbtnlRsvp);
                                rbtnlRsvp.SelectedValue = DataBinder.Eval(gdiItem.DataItem, "Rsvp").ToString();
                            }

                            #endregion
                        }
                    }
                }
                else if (e.Item is GridFooterItem)
                {
                    GetGridTotals();

                    Label lblRegisteredTotals = (Label)e.Item.FindControl("lblRegisteredTotals"); 
                    Label lblOtherTotals = (Label)e.Item.FindControl("lblOtherTotals");

                    if (Int32.Parse(Registered.ToString()) != 0)
                    {
                        lblRegisteredTotals.Text = string.Format("Registered: {0}", Registered);
                    }             
                    if (Int32.Parse(Other.ToString()) != 0)
                    {
                        lblOtherTotals.Text = string.Format("Other: {0}", Other);
                    }
                }
            }
  2. Prangadj
    Prangadj avatar
    174 posts
    Member since:
    Jan 2008

    Posted 27 Aug 2009 Link to this post

    Try some troubleshooting after reading the Web resources troubleshooting from the Telerik help and the answers in the ASP.NET forum threads here:

    http://www.telerik.com/help/aspnet-ajax/web-resources-troubleshooting.html

    http://forums.asp.net/t/1207960.aspx
    http://forums.asp.net/t/1393141.aspx

    Hope they are helpful.

    Prangadj
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top