<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadNotificationSolution.Default" %><%@ 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></title> <telerik:RadCodeBlock runat="server"> <script type="text/javascript"> var timeLeftCounter = null; var seconds = 60; //a flag to ease the logic which determines whether to redirect the user //will not redirect if the RadButton is clicked var toRedirect = true; //stop timers for UI function stopTimer(timer) { clearInterval(this[timer]); this[timer] = null; }; //reset timers for UI function resetTimer(timer, func, interval) { this.stopTimer(timer); this[timer] = setInterval(Function.createDelegate(this, func), interval); }; function OnClientShowing(sender, args) { console.log("OnClientShowing()"); resetTimer("timeLeftCounter", UpdateTimeLabel, 1000); //raise the flag again so that a redirect will occur if the notification autocloses toRedirect = true; } function OnClientHiding(sender, args) { if (toRedirect) { window.location.href = sender.get_value(); } } //update the text in the label in RadNotification //this could also be done automatically by using UpdateInterval. However, this will cause callbacks [which is the second best solution than javascript] on every second that is being count function UpdateTimeLabel(toReset) { console.log("UpdateTimeLabel():", toReset); var sessionExpired = (seconds == 0); if (sessionExpired) { stopTimer("timeLeftCounter"); //redirect to session expired page - simply take the url which RadNotification sent from the server to the client as value window.location.href = $find("RadNotificationSessionTimeout").get_value(); } else { var timeLbl = $get("timeLbl"); timeLbl.innerHTML = seconds--; } } function ContinueSession() { console.log("ContinueSession()"); var notification = $find("RadNotificationSessionTimeout"); toRedirect = false; notification.update(); notification.hide(); } </script> </telerik:RadCodeBlock> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <div> <asp:Literal runat="server" ID="literalContent"></asp:Literal> <telerik:RadNotification ID="RadNotificationSessionTimeout" runat="server" ClientIDMode="Static" Position="Center" Width="240" Height="200" OnCallbackUpdate="OnCallbackUpdate" Value="/Logout.aspx?timeout=true" AutoCloseDelay="60000" Title="Stay Signed In?" Skin="Office2010Blue" EnableRoundedCorners="true" OnClientShowing="OnClientShowing" OnClientHiding="OnClientHiding" LoadContentOn="PageLoad" ShowCloseButton="False" > <ContentTemplate> <div class="notificationContent">Time remaining: <span id="timeLbl">60</span> <%--<telerik:RadButton Skin="Office2007" ID="continueSession" runat="server" Text="Continue Your Session" Style="margin-top: 10px;" AutoPostBack="false" OnClientClicked="ContinueSession"> </telerik:RadButton>--%> <asp:Button ID="continueSession" runat="server" Text="Continue Your Session" Style="margin-top: 10px;" AutoPostBack="false" OnClientClicked="ContinueSession"> </asp:Button> </div> </ContentTemplate> </telerik:RadNotification> </div> </form> </body></html>using System;using Telerik.Web.UI;namespace RadNotificationSolution{ public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Random random = new Random(); literalContent.Text = random.Next().ToString(); // Session Timeout Config if (!IsPostBack) { //set the expire timeout for the session Session.Timeout = 2; //configure the notification to automatically show 1 min before session expiration RadNotificationSessionTimeout.ShowInterval = (Session.Timeout - 1) * 60000; //set the redirect url as a value for an easier and faster extraction in on the client RadNotificationSessionTimeout.Value = Page.ResolveClientUrl("Logout.aspx?timeout=true"); } } protected void OnCallbackUpdate(object sender, RadNotificationEventArgs e) { } }}<Telerik.Web.UI.RadNumericTextBox ID="tbActivityValue" Culture="nl-NL" CssClass="moneybox" NumberFormat-DecimalDigits="2" runat="server" MinValue="0" TabIndex="1"></Telerik.Web.UI.RadNumericTextBox>When I uploaded media into a post.I saw the media automatic started.
What the default property of media? automatic started?
How to set the default property of media to start by user (Auto Start = false)?
Thank you
| <telerik:GridCalculatedColumn UniqueName="Date" DataType="System.DateTime" DataFields="Received" |
| Expression="Received.Value.Date" HeaderText="Date" Visible="false"> |
| </telerik:GridCalculatedColumn> |
| <telerik:GridCalculatedColumn UniqueName="Conversation" DataType="System.String" |
| DataFields="Subject" Expression='Subject.Replace("RE: ", "")' HeaderText="Conversation" |
| Visible="false"> |
| </telerik:GridCalculatedColumn> |
Folks
Enviromnent: VS 2010 with RadControls for ASP.NET AJAX Q2 2011 SP1. I am using below link as a prototype for my project.
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/gridattachmentcolumn/defaultcs.aspx
In my project, Download options works if they are not inside edit table. Below declarations works.
<div style="margin-bottom: 5px;"> <telerik:RadComboBox ID="FileNamesComboBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="FileName" DataValueField="ID" CssClass="rgExpXLS"> </telerik:RadComboBox> <asp:LinkButton ID="LinkButton_Dwnload" runat="server" OnClick="DownloadButton_Click" Text="DownLoad"></asp:LinkButton> </div> protected void DownloadButton_Click(object sender, EventArgs e) { int attachmentId = Int32.Parse(FileNamesComboBox1.SelectedValue); string fileName = FileNamesComboBox1.SelectedItem.Text; SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ConnectionString); SqlCommand comm = new SqlCommand("SELECT [BinaryData] FROM [FileData] WHERE [ID] = @ID", conn); comm.Parameters.Add(new SqlParameter("@ID", attachmentId)); SqlDataAdapter adapter = new SqlDataAdapter(comm); DataSet data = new DataSet(); adapter.Fill(data); byte[] binaryData = (byte[])data.Tables[0].Rows[0]["BinaryData"]; int ii = attachmentId; Response.Clear(); Response.ContentType = "application/octet-stream"; Response.AddHeader("content-disposition", "attachment; filename=" + fileName); Response.BinaryWrite(binaryData); Response.End(); }__________________________
But if the download options are within Edit Table, it does not work. Declaration and code:
<EditFormSettings EditFormType="Template"> <FormTemplate> <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none" style="border-collapse: collapse; background: white;"> <tr> <td> <div style="margin-bottom: 5px;"> <telerik:RadComboBox ID="FileNamesComboBox" runat="server" DataSourceID="SqlDataSource1" DataTextField="FileName" DataValueField="ID"> </telerik:RadComboBox> <asp:LinkButton ID="LinkButtonEditTable" runat="server" OnClick="DownloadLinkButtonEditTable_Click" Text="Download from Edit Table" Font-Size="Medium" ForeColor="Red"></asp:LinkButton> </div> </td> </tr> </table> </FormTemplate> </EditFormSettings> protected void DownloadLinkButtonEditTable_Click(object sender, EventArgs e) { LinkButton btn = sender as LinkButton; if (btn.NamingContainer is GridEditableItem ) { // Edit mode GridEditableItem container = (GridEditableItem)btn.NamingContainer; RadComboBox SLurlComboBox = (RadComboBox)container.FindControl("FileNamesComboBox"); int attachmentId = Int32.Parse(SLurlComboBox.SelectedValue); int ii = attachmentId; string fileName = SLurlComboBox.SelectedItem.Text; SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ConnectionString); SqlCommand comm = new SqlCommand("SELECT [BinaryData] FROM [FileData] WHERE [ID] = @ID", conn); comm.Parameters.Add(new SqlParameter("@ID", attachmentId)); SqlDataAdapter adapter = new SqlDataAdapter(comm); DataSet data = new DataSet(); adapter.Fill(data); byte[] binaryData = (byte[])data.Tables[0].Rows[0]["BinaryData"]; Response.Clear(); Response.ContentType = "application/octet-stream"; Response.AddHeader("content-disposition", "attachment; filename=" + fileName); Response.BinaryWrite(binaryData); Response.End(); } }
My project requires download be done within Edit Table. Attached is the error message while trying to download from Edit Table;
Any help will be appreciated. Thanks
gc_0620