public IEnumerable<ScriptReference> GetScriptReferences() { yield return new ScriptReference("HierarchyTree1.HierarchyTree.js", GetType().Assembly.FullName);}<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GlobalException.aspx.cs" Inherits="GlobalException" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title></title></head><body> <form id="form2" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <telerik:RadFormDecorator ID="FormDecorator" runat="server" DecoratedControls="all" /> <telerik:RadSkinManager runat="server" ID="SkinManager" Skin="Windows7" PersistenceKey="Skin" PersistenceMode="ViewState" /> <telerik:RadWindowManager ID="CommonWindowManager" runat="server" Behaviors="Resize, Maximize, Move"> <Windows> <telerik:RadWindow ID="ExceptionWindow" runat="server" VisibleOnPageLoad="true"> <ContentTemplate> <telerik:RadSplitter ResizeWithParentPane="true" ResizeWithBrowserWindow="true" ID="MainSplitter" runat="server" Orientation="Horizontal"> <telerik:RadPane ID="TopPane" runat="server"> <telerik:RadTabStrip ID="exceptionTabStrip" runat="server" SelectedIndex="0" MultiPageID="exceptionMultiPage"> <Tabs> <telerik:RadTab runat="server" Text="message" Selected="True"> </telerik:RadTab> <telerik:RadTab runat="server" Text="details"> </telerik:RadTab> </Tabs> </telerik:RadTabStrip> </telerik:RadPane> </telerik:RadSplitter> </ContentTemplate> </telerik:RadWindow> </Windows> </telerik:RadWindowManager> </form></body></html>In my particular case, I'm building a web-based intranet app for a multi-billion dollar company. But within that company its actual userbase will be less than 50. As was the case with the app's VB6 WinForms predecessor, I will almost certainly be required to make periodic improvements to it over the next decade. Because of this it's critically important to minimize the amount of client-side code and instead maximize the amount of type-safe, well structured server-side code.
To Telerik, all I'm asking for is this: Wherever possible, please include a server-side solution (or mostly server-side solution) where you have traditionally presented a strictly client-side solution in times past. This will go a LONG WAY to helping developers (and loyal customers) like myself.
Sincerely,
Robert Werner
Vancouver, BC
var combo = $find("<%= RadComboBox1.ClientID %>"); combo.disable();
var picker = $find("<%= RadDatePicker1.ClientID %>"); picker.set_enabled(false);
<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="prospectGrid"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="prospectGrid" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="prospectGrid" /> </UpdatedControls> </telerik:AjaxSetting> </telerik:RadAjaxManager><telerik:RadGrid ID="prospectGrid" AllowFilteringByColumn="true" AllowPaging="True" PageSize="50" runat="server" AllowSorting="true" OnNeedDataSource="prospectGrid_NeedDataSource" GridLines="None" AllowMultiRowSelection="false" Height="450px" OnItemDataBound="OnDataBound"> <PagerStyle Visible="false" /> <MasterTableView DataKeyNames="ID" TableLayout="Fixed" AutoGenerateColumns="false"> <Columns> <telerik:GridBoundColumn DataField="ID" HeaderText="ProspectId" Display="false" UniqueName="ProspectId" /> <telerik:GridTemplateColumn DataField="Live" HeaderText="Live" AllowFiltering="false" HeaderStyle-Width="30px"> <ItemTemplate> <center> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/live.png" Visible='<%#Eval("Live") %>' /></center> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="PartnerCompany" HeaderText="Partner Company" UniqueName="PartnerCompany" /> <telerik:GridBoundColumn DataField="PersonName" HeaderText="Person Name" UniqueName="CustomerName" /> <telerik:GridBoundColumn DataField="ServiceType" HeaderText="Service Type" UniqueName="ServiceType" /> <telerik:GridBoundColumn DataField="PersonContact" HeaderText="Person Contact" UniqueName="Contact" /> <telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title" /> <telerik:GridBoundColumn DataField="PersonDirectNumber" HeaderText="Person Direct No" UniqueName="Phone No" /> <telerik:GridBoundColumn DataField="PersonEmail" HeaderText="Person Email" UniqueName="Email" /> <telerik:GridBoundColumn DataField="FollowUpDate" HeaderText="FollowUp Date" UniqueName="FollowUpDate" /> <telerik:GridBoundColumn DataField="FollowUpDesc" HeaderText="Follow Up Desc" UniqueName="Description" /> <telerik:GridBoundColumn DataField="ContractETA" HeaderText="Contract ETA" UniqueName="CotnactETA" /> <telerik:GridBoundColumn DataField="ServiceETA" HeaderText="Service ETA" UniqueName="ServiceETA" /> <telerik:GridTemplateColumn DataField="NotesDesc" HeaderText="Notes" AllowFiltering="false" HeaderStyle-Width="55px"> <ItemTemplate> <center> <a href="#" onclick="notesClick('<%#DataBinder.Eval(Container.DataItem,"ID")%>'); return false;"> <input type="image" src="images/note.png" /></a></center> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="" HeaderText="Follow Up" AllowFiltering="false" HeaderStyle-Width="70px"> <ItemTemplate> <center> <asp:HyperLink ImageUrl="~/images/schedule.png" ID="schedule" runat="server" /> </center> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true" Resizing-AllowColumnResize="true" EnablePostBackOnRowClick="false"> <ClientEvents OnRowDblClick="OnRowDblClick" /> <Selecting AllowRowSelect="false" /> <Scrolling AllowScroll="true" FrozenColumnsCount="3" UseStaticHeaders="true" SaveScrollPosition="true" /> <ClientEvents OnScroll="handleScrolling" /> </ClientSettings> <HeaderStyle Width="200px" /> </telerik:RadGrid><telerik:RadCodeBlock runat="server"> function handleScrolling(e) { var grid = $find("<%=prospectGrid.ClientID %>"); var scrollArea = document.getElementById("<%= prospectGrid.ClientID %>" + "_GridData"); if (IsScrolledToBottom(scrollArea)) { var currentlyDisplayedRecords = grid.get_masterTableView().get_pageSize() * (grid.get_masterTableView().get_currentPageIndex() + 1); //if the presently visible items are less than the entire source records count //trigger an ajax request to increase them if (currentlyDisplayedRecords < 30) { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("LoadMoreRecords"); } } } //this method calculates whether you have reached the bottom when dragging the vertical grid scroll function IsScrolledToBottom(scrollArea) { var currentPosition = scrollArea.scrollTop + scrollArea.clientHeight; return currentPosition == scrollArea.scrollHeight; }</telerik:RadCodeBlock>protected void prospectGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { prospectGrid.VirtualItemCount = DbContext.getProspectProfile(startRowIndex ,endRowIndex).ToList().Count(); int totalCount = prospectGrid.VirtualItemCount; int startRowIndex = (prospectGrid.CurrentPageIndex * prospectGrid.PageSize) + 1; int endRowIndex = ((startRowIndex + 15) > totalCount ? totalCount : startRowIndex + 15) - 1; prospectGrid.DataSource = DbContext.getProspectProfile(startRowIndex ,endRowIndex); }