| <%@ WebHandler Language="C#" Class="Telerik.Web.Examples.FileExplorer.FilterAndDownloadFiles.Handler" %> |
| using System; |
| using System.Data; |
| using System.Configuration; |
| using System.Web; |
| using System.Text; |
| using Telerik.Web.UI; |
| namespace Telerik.Web.Examples.FileExplorer.FilterAndDownloadFiles |
| { |
| [RadCompressionSettings(HttpCompression = CompressionType.None)] // Disable RadCompression for this page ; |
| public class Handler : IHttpHandler |
| { |
| #region IHttpHandler Members |
| private HttpContext _context; |
| private HttpContext Context |
| { |
| get |
| { |
| return _context; |
| } |
| set |
| { |
| _context = value; |
| } |
| } |
| public void ProcessRequest(HttpContext context) |
| { |
| Context = context; |
| string filePath = context.Request.QueryString["path"]; |
| filePath = context.Server.MapPath(filePath); |
| if (filePath == null) |
| { |
| return; |
| } |
| System.IO.StreamReader streamReader = new System.IO.StreamReader(filePath); |
| System.IO.BinaryReader br = new System.IO.BinaryReader(streamReader.BaseStream); |
| byte[] bytes = new byte[streamReader.BaseStream.Length]; |
| br.Read(bytes, 0, (int)streamReader.BaseStream.Length); |
| if (bytes == null ) |
| { |
| return; |
| } |
| streamReader.Close(); |
| br.Close(); |
| string extension = System.IO.Path.GetExtension(filePath); |
| string fileName = System.IO.Path.GetFileName(filePath); |
| if (extension == ".jpg") |
| { |
| WriteFile(bytes, fileName, "image/jpeg jpeg jpg jpe", context.Response); |
| } |
| else if (extension == ".gif") |
| { |
| WriteFile(bytes, fileName, "image/gif gif", context.Response); |
| } |
| else if (extension == ".png") |
| { |
| WriteFile(bytes, fileName, "image/x-png", context.Response); |
| } |
| else if (extension == ".tif") |
| { |
| WriteFile(bytes, fileName, "image/tiff", context.Response); |
| } |
| else if (extension == ".pdf") |
| { |
| WriteFile(bytes, fileName, "application/pdf", context.Response); |
| } |
| else if (extension == ".png") |
| { |
| WriteFile(bytes, fileName, "image/x-png", context.Response); |
| } |
| else if (extension == ".txt") |
| { |
| WriteFile(bytes, fileName, "text/plain", context.Response); |
| } |
| else if (extension == ".zip") |
| { |
| WriteFile(bytes, fileName, "application/zip", context.Response); |
| } |
| } |
| /// <summary> |
| /// Sends a byte array to the client |
| /// </summary> |
| /// <param name="content">binary file content</param> |
| /// <param name="fileName">the filename to be sent to the client</param> |
| /// <param name="contentType">the file content type</param> |
| private void WriteFile(byte[] content, string fileName, string contentType, HttpResponse response) |
| { |
| response.Buffer = true; |
| response.Clear(); |
| response.ContentType = contentType; |
| response.AddHeader("content-disposition", "attachment; filename=" + fileName); |
| response.BinaryWrite(content); |
| response.Flush(); |
| response.End(); |
| } |
| public bool IsReusable |
| { |
| get |
| { |
| return false; |
| } |
| } |
| #endregion |
| } |
| } |
Riga 109: response.AddHeader("content-disposition", "attachment; filename=" + fileName);
|

ow.moveTo(0, 0);
ow.Minimize();
ow.Maximize();
In all cases the window fails to appear and the page becomes locked.
I am using ther 2010 Q3 release, but this behavour also showed in previous releases. Any help appreciated.
David Penny
<telerik:RadComboBox ID="RadComboBoxProviders" Runat="server" height="200px" EnableAutomaticLoadOnDemand="true" DataSourceID="LinqDataSourceProviders" DataTextField="Name" EmptyMessage="Select Provider" ItemsPerRequest="10" EnableVirtualScrolling="true" DataValueField="ProviderId" Skin="Web20"> </telerik:RadComboBox> <asp:LinqDataSource ID="LinqDataSourceProviders" runat="server" ContextTypeName="ClinicalDataContext" EntityTypeName="" Select="new (Name, Street1, City, State, ProviderId)" TableName="ExternalProviders"> </asp:LinqDataSource> for (int i = 0; i < 5; i++)
{
ButtonArray[i].ActionButton.ButtonFillElement.BackColor = System.Drawing.Color.transparent; <- Setting the original Values
ButtonArray[i].ActionButton.ButtonFillElement.BackColor2 = System.Drawing.Color.transparent;
ButtonArray[i].ActionButton.ButtonFillElement.BackColor3 = System.Drawing.Color.transparent;
ButtonArray[i].ActionButton.ButtonFillElement.BackColor4 = System.Drawing.Color.transparent;
}
/*Setting Selected Values...*/
SendingSplitButton.ActionButton.ButtonFillElement.BackColor = System.Drawing.Color.FromArgb(255,255,115,0);
SendingSplitButton.ActionButton.ButtonFillElement.BackColor2 = System.Drawing.Color.FromArgb(255,255, 115, 0);
SendingSplitButton.ActionButton.ButtonFillElement.BackColor3 = System.Drawing.Color.FromArgb(255,255, 115, 0);
SendingSplitButton.ActionButton.ButtonFillElement.BackColor4 = System.Drawing.Color.FromArgb(255,255, 115, 0);
SendingSplitButton.ActionButton.ButtonFillElement.GradientPercentage = 0.62f;
SendingSplitButton.ActionButton.ButtonFillElement.GradientPercentage = 0.71f;
}
I have already tried changing the State of the Objects in this mode:
SendingSplitButton.OnMouseOver = true or with SendingSplitButton.OnMouseDown= true but it doesn't work. I don't understand very well if it is possible or not managing only a single state of the object through the code and how the Style Managing - by code - and Xml is merged.
Thank you very Much,