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

RadGrid ClientEvents OnRowSelected Not Working On Web Server

3 Answers 240 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 08 Aug 2014, 02:15 PM
Hello,

I have a RadGrid which I have set OnRowSelected event under ClientEvents to call a JS function.  This works on my local machine, but when I deploy to web server it is not working.  Any ideas why????  My code is below.

Thanks,

Brad



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="home.aspx.cs" Inherits="Test.home" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0" />
    <title></title>

    <script src="Scripts/jquery-1.8.2.js"></script>

    <script type="text/javascript">
        function RowSelected(sender, eventArgs) {
            alert('hello');
            var grid = sender;
            var MasterTable = grid.get_masterTableView();
            var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
            var cell = MasterTable.getCellByColumnUniqueName(row, "RecordID");
           
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager>
        <div class="SearchResultsDiv">
            <asp:Label Text="Search Results" runat="server" CssClass="SearchResultsHeader"></asp:Label><asp:Label Text="(Click to view)" runat="server"></asp:Label>
                <telerik:RadGrid ID="rgrdSearchResults" runat="server" AllowPaging="True" CssClass="RadGridMargin" BorderColor="Black" OnPreRender="rgrdSearchResults_PreRender">
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" />
                        <ClientEvents OnRowSelected="RowSelected" />
                    </ClientSettings>
                </telerik:RadGrid>
        </div>
    </form>
</body>
</html>

3 Answers, 1 is accepted

Sort by
0
Brad
Top achievements
Rank 1
answered on 08 Aug 2014, 03:55 PM
Got a little bit closer to the problem.  When I deploy to a different web server, the ClientEvents of RadGrid work.  However, still does not work on initial web server (which is where it needs to be).  Guessing it may be something with IIS, but do not really see any differences between the 2 servers.  Thoughts???

Thanks in advance,

Brad
0
Viktor Tachev
Telerik team
answered on 13 Aug 2014, 11:27 AM
Hello Brad,

The issue you describe seems rather strange. One of the common reasons for a client script not to work is a JavaScript error. Would you check the browser console for any script errors on the page?

Also there are couple of threads on stackoverflow and asp.net forums that describe similar issue. The following resources might help in resolving the issue:

http://stackoverflow.com/questions/3771831/iis-7-5-no-images-css-js-showing

http://forums.asp.net/t/1770819.aspx?Javascript+js+files+not+working+in+IIS+7+5


Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Brad
Top achievements
Rank 1
answered on 13 Aug 2014, 02:29 PM
I am ashamed to admit, but the problem (which I obviously overlooked) was the fact that .NET 4.0 was not installed on the server.  Once I ran that on the server, it worked.  Thanks for the help, though.

Thanks,

Brad
Tags
Grid
Asked by
Brad
Top achievements
Rank 1
Answers by
Brad
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or