Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
200 views
After implementing the RadCompression model on a previously working ashx page I was using for secure file downloads, itstopped working in Firefox, Chrome, & Safari, but continued to work in IE (tested v9).  I found 2 possible places for the error, but due to time constraints had to stop and simply remove the RadCompression module.

1.    On my development box, Win 7, IIS 7, flushing the data (context.Response.Flush()) between the header and the content caused the browsers listed above to report an invalid compression.

2. On my production server, Windows Server 2003, IIS 6, the browsers just sit there and spin, as if they are waiting for more content.  I think this is due to my manually adding a "Content-Length" based on the size of the uncompressed content.  Is there a sample showing the correct parameters to set when using RadCompression in this scenario?  My page, based on parameters, may return any of the following, and so I am also setting the content type and content-disposition headers manually:

    a.    HTML (text/html)
    b.    Text (text/plain)
    c.    Zip (application/zip)
    d.    Excel (application/vnd.ms-excel)
    e.    Excel 2007 (application/vns.openxmlformats-officedocument.spreadsheetml.sheet)
    f.    Jpg (image/jpeg)

These files are dynamically generated, so I would also like to specify "no-cache" in the sample as well.

The following is my working (without RadCompression) sample. (Again, it works in IE, but not others.)

Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
 
        '''The following 2 lines do not seem to make a difference, but were added when trying to test
        context.Response.Clear
        context.Response.BufferOutput = True
 
        'Get the filename
        Dim fileName As String = context.Request.QueryString("i")
         
        'Get the file type
        Dim fileType As String = context.Request.QueryString("t")
         
        'Get the project name
        Dim projectName As String = Managers.SessionManager.ProjectName(context.Session)
         
        'Get the userId
        Dim userId As Integer = Managers.SessionManager.UserId(context.Session)
         
        'Make sure the project and user name are valid
        If IsProjectAndUserValid(projectName, userId) = True Then
         
            Dim securePath As String = Utilities.IO.GetSecureDirectory(Managers.ConfigManager.SecureOutput, projectName, userId)
         
            'Create the full physical path to the file       
            Dim fullPath As String = IO.Path.Combine(securePath, fileName)
         
            'See if the file exist
            If IO.File.Exists(fullPath) Then
                'Open a fileinfo object for the file
                Dim currentFileInfo As New IO.FileInfo(fullPath)
                 
                Select Case fileType.ToLower
                    Case "zip"
                        context.Response.AddHeader("Content-Disposition", "attachment;filename=MyZip.zip")
                        context.Response.ContentType = "application/zip"
                    Case "export"
                        'Get the fileextension
                        Dim fileExtension As String = IO.Path.GetExtension(fullPath)
                        If fileExtension = ".html" OrElse fileExtension = ".htm" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.htm")
                            context.Response.ContentType = "text/html"
                        ElseIf fileExtension = ".txt" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.txt")
                            context.Response.ContentType = "text/plain"
                        ElseIf fileExtension = ".xls" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.xls")
                            context.Response.ContentType = "application/vnd.ms-excel"
                        ElseIf fileExtension = ".xlsx" Then
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=Export.xlsx")
                            context.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                        End If
                    Case "print"
                        context.Response.ContentType = "text/html"
                    Case "image"
                        context.Response.AddHeader("Content-Disposition", "inline;filename=Print.jpg")
                        context.Response.ContentType = "image/jpeg"
                End Select
                 
                '''The following line has had inconsistant results in some browsers
                'context.Response.CacheControl = "no-cache"
                '''Is the following line is another (unconfirmed) problem for RadCompression?
                context.Response.AddHeader("Content-Length", currentFileInfo.Length.ToString)
                context.Response.StatusCode = 200
                ''''The following line breaks RadCompression in IIS7
                'context.Flush()
                context.Response.WriteFile(fullPath)
                context.Response.Flush()
                context.Response.End()
            Else
                context.Response.StatusCode = 200
                context.Response.Write("No data located for this request.")
                context.Response.End()
            End If
             
        End If     
         
    End Sub

Chuck
Top achievements
Rank 1
 answered on 31 Jan 2012
10 answers
414 views
Hi Telerik Team,

I have a very strange requirement from the customer. Customer is using a RAD Grid with GridTemplateColumn used having both HeaderTemplate & ItemTemplate => both having a check-box.

I just followed this link  to set the checkbox to the RAD Grid.


Ex: Assume that the RAD Grid is having 3 records with a check-box similiar to the screenshot given in the above link. When we select "HeaderCheckbox", all the item check-boxes are selected which is clear.

User is now trying to now select all 3 records (item template records) manually. Please keep in mind that Multi-select is allowed for my grid. What customer is asking why is header check-box not selected for this scenario? 

So in ToggleRowSelection method, I tried to access headertemplate check-box and set the check-box to checked but I am not able to achieve it. I tried with RadGrid1.MasterTableView.Columns[0] and tried to find the checkbox. But I couldn't find it.

could you please let me know how to access HeaderTemplate check-box from ItemTemplate check-box event handler?
protected void ToggleRowSelection(object sender, EventArgs e)
{
((sender
 as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;
}


Regards,
Kishan G K


Regards,
Kishan G K
Roselin
Top achievements
Rank 1
 answered on 31 Jan 2012
1 answer
45 views
Hi,

It's possible to add a user control from page methods?If yes, how?
I need this because I want to add a usercontrol to a node of a tree. I use web service like expand mode.
Thanks,
Timo
Plamen
Telerik team
 answered on 31 Jan 2012
1 answer
71 views
Hi
I am using a RadGrid to drag and drop onto a RadScheduler. The page works and functions exactly as required in a standard page, however, when I place exactly the same code into a page that calls a masterpage I get a javascript error "'null' is null or not an object"

I'm assuming this would be something to do with the following javascript, however I cant pinpoint exactly what.

<script type="text/javascript">
            function rowDropping(sender, eventArgs) {
                // Fired when the user drops a grid row
                var htmlElement = eventArgs.get_destinationHtmlElement();
                var scheduler = $find('<%= RadScheduler1.ClientID %>');
  
                if (isPartOfSchedulerAppointmentArea(htmlElement)) {
                    // The row was dropped over the scheduler appointment area
                    // Find the exact time slot and save its unique index in the hidden field
                    var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
                    alert(timeSlot.get_index());
                    $get("TargetSlotHiddenField").value = timeSlot.get_index();
  
                    // The HTML needs to be set in order for the postback to execute normally
                    eventArgs.set_destinationHtmlElement("TargetSlotHiddenField");
                }
                else {
                    // The node was dropped elsewhere on the document
                    eventArgs.set_cancel(true);
                }
            }
  
            function isPartOfSchedulerAppointmentArea(htmlElement) {
                return $telerik.$(htmlElement).parents().is("div.rsAllDay") ||
                            $telerik.$(htmlElement).parents().is("div.rsContent")
            }
  
            function onRowDoubleClick(sender, args) {
                sender.get_masterTableView().editItem(args.get_itemIndexHierarchical());
            }
        </script>


Any pointers on why this wouldnt work on a page that calls a masterpage would be much appreciated - I tested this with a masterpage that was essentially blank as well with no other scripts included on it.

Many thanks.
Karl.
Plamen
Telerik team
 answered on 31 Jan 2012
1 answer
74 views
I'm using rad grid grouping and when expanding groups they should be ajaxified but for some reasons it's still doing a full postback.
Can you help? Here is the code:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                       <AjaxSettings>
                           <telerik:AjaxSetting AjaxControlID="grdActivity">
                               <UpdatedControls>
                                   <telerik:AjaxUpdatedControl ControlID="grdActivity" LoadingPanelID="RadAjaxLoadingPanel1" />
                               </UpdatedControls>
                           </telerik:AjaxSetting>
                       </AjaxSettings>
                   </telerik:RadAjaxManager>
                   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
                   </telerik:RadAjaxLoadingPanel>
                  <div id="RecentActivityContent" class="QuickViewContent">
                     <telerik:RadGrid runat="server" ID="grdActivity" DataSourceID="objActivity" Width="360px"
                      GridLines="Horizontal" Skin="Sunset" ShowHeader="false" >
                      <HeaderStyle CssClass="HistoryGridHeader" />
                       <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                       <MasterTableView AutoGenerateColumns="false" CssClass="GridRecentActivity">
                           <GroupByExpressions>
                               <telerik:GridGroupByExpression>
                                   <SelectFields>
                                       <telerik:GridGroupByField FieldAlias="Date" FieldName="Date" FormatString="{0:D}"
                                           HeaderValueSeparator=" from date: " />
                                   </SelectFields>
                                   <GroupByFields>
                                       <telerik:GridGroupByField FieldName="Date" SortOrder="Descending" >
                                       </telerik:GridGroupByField>
                                   </GroupByFields>
                               </telerik:GridGroupByExpression>
                           </GroupByExpressions>
                           <Columns>
                               <telerik:GridTemplateColumn DataField="Message" HeaderText="Message" UniqueName="Message">
                                   <ItemTemplate>
                                       <asp:Label runat="server" id="Label1" Text='<%# Eval("Type") %>' CssClass="FirstColumn" />   -  
                                       <asp:Label runat="server" id="lblMessage" Text='<%# Eval("Message") %>' />
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                           </Columns>
                       </MasterTableView>
                       <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                           <Selecting AllowRowSelect="True"></Selecting>
                           <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                           ResizeGridOnColumnResize="False"></Resizing>
           </ClientSettings>
                   </telerik:RadGrid>
Thanks,
Ron.
Shinu
Top achievements
Rank 2
 answered on 31 Jan 2012
1 answer
83 views
Hello,
 
 I want to get whole HTML text from the Rad Editor i.e.,not the content but the html format of the design mode.If I type some thing in the design mode obviously I ll get some Html text for that.I want to store that html in my database not the editor content.

I want to store only in the Html format.As I am sending Emails by using this.

I searched too many posts.But,I didnt any exact solution for my problem.Please help me.


Thanks.
Rams
Princy
Top achievements
Rank 2
 answered on 31 Jan 2012
1 answer
75 views
hi
i m using telerik scheduler for appointments in my advance edit template i show appoinment detail and resource detail.. and a button to prescribe when button click its transfer to other page.. now i want to send appointment id and a resource patient id to other page...
kindly hlep me
regards,
Peter
Telerik team
 answered on 31 Jan 2012
3 answers
36 views
Hi, I'm using Telerik RadEditor in my asp.net project, unfortunately there are too much items in the toolbar which i don't use them at all. How can I remove them from RadEdior?
Rumen
Telerik team
 answered on 31 Jan 2012
1 answer
76 views
Hello!

I have a trial version ( ASP AJAX Q2 2011) installed in my computer which I used to learn the example before.
We also have bought a version from telerik. I replaced them( purchased version) into a project folder-"Telerik" and the project reference to dlls in the folder in VS2010.
But when I run(debug) the project from VS2010, it still shows the trial version and ask to buy.

Why is it like it and how can I elimilate to show trial version? Do I have to delete the trial version in GAC in my local computer or I have to put all these purchased version dlls into bin and reference to the bin?
I just need to know what is the right approach to the reference. I usually put all dlls into seperate folder and think it is the correct approach.

Thanks for help in advance.

Amy
Rumen
Telerik team
 answered on 31 Jan 2012
1 answer
194 views
we need control Drag and drop as items as below picture
Drag and drop the items below to change the order they appear on your report.
please can help me is any Telerik control like this
Marin
Telerik team
 answered on 31 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?