or
Hi,
I want to have a ajax postback raised when the contents of an editor control changes.
I have set up the OnTextChanged event for the editor control but as expected it is not being called as there is no postback happening, what is the best way to raise an ajax request when the controls contents change on the client side?
something along the lines of .....
function editorload(editor)
{
editor.attachEventHandler("onkeydown", checkkeypress);
}
function checkkeypress(e)
{
//ajax postback here
}
Thanks in advance
Mac

| using System; |
| using System.Data; |
| using System.Configuration; |
| using System.Collections; |
| using System.Web; |
| using System.Web.Security; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using System.Web.UI.WebControls.WebParts; |
| using System.Web.UI.HtmlControls; |
| using C21Online.Solution.DAL.App; |
| using Telerik.Web.UI; |
| public partial class MyListings_media_sequence : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (Request["tr_key"] != "") |
| { |
| BuildThePage(Convert.ToInt32(Request["tr_key"].ToString())); |
| } |
| } |
| private void BuildThePage(int tr_key) |
| { |
| DataSet PhotosDS = new DataSet(); |
| PhotosDS = Listings.GetPhotosByListing(tr_key); |
| if (PhotosDS != null) |
| { |
| Image img; |
| for (int i = 0; i < PhotosDS.Tables[0].Rows.Count; i++) |
| { |
| img= new Image(); |
| img.CssClass = "thumbnail"; |
| img.ID = "thumbnail_" + i.ToString(); |
| img.ImageUrl = PhotosDS.Tables[0].Rows[i]["URL"].ToString().Trim(); |
| img.Width = Unit.Pixel(100); |
| img.Height = Unit.Pixel(80); |
| img.ToolTip = PhotosDS.Tables[0].Rows[i]["Title"].ToString().Trim(); |
| RadDock rd = new RadDock(); |
| rd.ID = "DockPhoto_" + i.ToString(); |
| rd.DockMode = DockMode.Docked; |
| rd.Title = (i+1).ToString(); |
| rd.DockHandle = DockHandle.TitleBar; |
| rd.ContentContainer.Controls.Add(img); |
| rd.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None; |
| rd.Width = Unit.Pixel(120); |
| rd.Height = Unit.Pixel(120); |
| RadDockZoneHorizontal1.Controls.Add(rd); |
| } |
| } |
| } |
| } |
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="media_sequence.aspx.cs" Inherits="MyListings_media_sequence" %> |
| <%@ 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 runat="server"> |
| <title>Photo Sequence</title> |
| <LINK href="~/css/sitestyles.css" type="text/css" rel="stylesheet"> |
| <script language="javascript" type="text/javascript" src="~/JS/main.js"></script> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server" > |
| </asp:ScriptManager> |
| <div> |
| <table cellpadding="0" cellspacing="0" border="0"> |
| <tr> |
| <td><img src="~/Images/Misc/spacer.gif" border="0" alt="" width="5" /></td> |
| <td style="vertical-align:top;"> |
| <telerik:RadDockLayout ID="RadDockLayout1" runat="server" Skin="Default" > |
| <telerik:RadDockZone runat="server" id="RadDockZoneHorizontal1" orientation="Horizontal" |
| BackColor="#8d8d8d" height="250px" width="650px"> |
| </telerik:RadDockZone> |
| </telerik:RadDockLayout> |
| <asp:PlaceHolder runat="server" id="phPhotos"></asp:PlaceHolder> |
| </td> |
| <td><img src="~/Images/Misc/spacer.gif" border="0" alt="" width="5" /></td> |
| </tr> |
| </table> |
| </div> |
| </form> |
| </body> |
| </html> |

| <asp:Panel ID="pnlDoc" runat="server" GroupingText="attachments" CssClass="pnlGroup" style="width:auto; table-layout:fixed"> |
| <div class="pnlWidthSet"></div> |
| <ucGt:g_GridTools ID="ucGridTool" runat="server" /> |
| <div class="pnlGroupInsidePanelGrid" id="divGridProduct" runat="server" style="width:auto;table-layout:fixed;"> |
| <telerik:RadGrid ID="grdDocs" runat="server" AutoGenerateColumns="False" ShowHeader="true" GridLines="None" BackColor="#ebecee" Skin="ObjectNext" ShowGroupPanel="false" EnableEmbeddedSkins="false" |
| onneeddatasource="grdDocs_NeedDataSource" onprerender="grdDocs_PreRender" onitemdatabound="grdDocs_ItemDataBound" ShowStatusBar="false" |
| ImagesPath="~/_common/style/objectnext/grid" AllowPaging="false" AllowSorting="true"> |
| <ExportSettings> |
| <Pdf FontType="Subset" PaperSize="Letter" /> |
| <Excel Format="Html" /> |
| </ExportSettings> |
| <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" AllowGroupExpandCollapse="true" EnablePostBackOnRowClick="false"> |
| <Selecting AllowRowSelect="false" /> |
| <Resizing AllowColumnResize="true" EnableRealTimeResize="true" /> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="350px" /> |
| <ClientEvents OnGridCreated="GridCreated" /> |
| </ClientSettings> |
| <MasterTableView CommandItemDisplay="None" GroupLoadMode="Client" CurrentResetPageIndexAction="SetPageIndexToFirst" Dir="LTR" Frame="Border" TableLayout="Fixed" |
| ItemStyle-CssClass="GridLowestLevelAltRow_ObjectNext" AlternatingItemStyle-CssClass="GridLowestLevelRow_ObjectNext" style="height:auto"> |
| <RowIndicatorColumn CurrentFilterFunction="NoFilter" |
| FilterListOptions="VaryByDataType" Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn CurrentFilterFunction="NoFilter" |
| FilterListOptions="VaryByDataType" Resizable="False" Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <EditFormSettings> |
| <EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"> |
| </EditColumn> |
| </EditFormSettings> |
| <Columns> |
| <telerik:GridTemplateColumn UniqueName="clmUploaded" HeaderText="date uploaded" SortExpression="uploaded"> |
| <ItemTemplate> |
| <asp:LinkButton ID="lkBtnDownload" runat="server" OnClientClick="downloadlink_click()" OnClick="DownloadLink_Click"><%#Eval("uploaded") %></asp:LinkButton> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn UniqueName="clmUserName" HeaderText="attached by" DataField="email"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="clmComment" HeaderText="comment" DataField="comments"></telerik:GridBoundColumn> |
| <%--invisible columns--%> |
| <telerik:GridBoundColumn UniqueName="clmName" HeaderText="name" DataField="name" Display="false"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="clmLocalFile" HeaderText="local file name" DataField="local_file" Display="false"></telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| </div> |
| </asp:Panel> |