This is a migrated thread and some comments may be shown as answers.

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

1 Answer 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
thecruciable
Top achievements
Rank 1
thecruciable asked on 24 Aug 2009, 08:03 PM
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);
                }
            }
        }

1 Answer, 1 is accepted

Sort by
0
Prangadj
Top achievements
Rank 1
answered on 27 Aug 2009, 11:05 AM
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
Tags
Grid
Asked by
thecruciable
Top achievements
Rank 1
Answers by
Prangadj
Top achievements
Rank 1
Share this question
or