Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
144 views
Hello everyone,

I am using The AsyncUpload in a Asp.Net app and it seems that only in IE we are having a problem when we try to upload a file. We have had testers try to upload a file that is 55MB's and we are only allowing 3MB files to be uploaded. What happens is that when the file is in the process of being uploaded we get a Javascript error and the file just stops uploaded but we cannot disable a message or anything to the user to tell them what happened. 

This is the error that I am getting:

Exception thrown and not caught  Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=LogoffWarning1_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a89093640-ae6b-44c3-b8ea-010c934f8924%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.3.1305.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ac331b262-facd-47ae-9de3-709a764247d7%3a16e4e7cd%3af7645509%3a8674cba1%3a7c926187%3ab7778d6c%3ac08e9f8a%3a59462f1%3aa51ee93e%3a24ee1bba%3a52af31a4%3af46195d3%3a874f8ea2%3a19620875%3a490a9d4e%3abd8f85e4, line 7191 character 1 

I looked in the code and the error is firing on the actual Catch statement. 

Line 7190: try(B=a.parseJSON(z.body.innerHTML);
Line 7191: } catch(A){j(y);

Any ideas?

Thank you,
Chris
chris
Top achievements
Rank 1
 answered on 30 Jan 2012
1 answer
112 views
UPDATED: My problem stems from the editor being on a secured page (not ssl, but via membership). Revised thoughts welcomed.

I am having a problem getting the Upload and Delete option to show in the RadEditor for any manager (image, document). I dumbed it down to this:
                    <telerik:RadEditor ID="RadEditor1" runat="server" Skin="WebBlue">
                        <Content>
                        </Content>
                        <ImageManager ViewPaths="~/ContentEditor/Images" DeletePaths="~/ContentEditor/Images"
                            UploadPaths="~/ContentEditor" />
                        <DocumentManager DeletePaths="~/ContentEditor/Documents" UploadPaths="~/ContentEditor/Documents"
                            ViewPaths="~/ContentEditor/Documents" />
                        <FlashManager DeletePaths="~/ContentEditor/Flash" UploadPaths="~/ContentEditor/Flash"
                            ViewPaths="~/ContentEditor/Flash" />
                        <MediaManager DeletePaths="~/ContentEditor/Media" UploadPaths="~/ContentEditor/Media"
                            ViewPaths="~/ContentEditor/Media" />
                    </telerik:RadEditor>
 I can see files fine. I can pick a file fine. I can resize the images fine. I just cannot get the Upload or Delete options to show up. The handler is in the web config, and I also added a location. I am running this locally using the built in VS web server. Some help would be great. Thanks.
Al
Top achievements
Rank 2
 answered on 30 Jan 2012
2 answers
119 views
I'm creating a RadComboBox programatically and I'm setting the RadComboBoxSelectedIndexChangedEventHandler. The function runs when the RadComboBox is changed, however, I can't seem to figure out how to get the value that it's being changed to. I seem to be one change behind when I'm evaluating it.

My code for the SelectedIndexChanged function is fairly simple
protected void dd_RptDate_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    if (e.Value == "DAILY")
        Session["s_datePickers"] = "true";
    else
        Session["s_datePickers"] = "false";
}

but e.Value gets me the existing value before I change it. I need to get the value it has been changed to. Any ideas? thanks.
Chris
Top achievements
Rank 1
 answered on 30 Jan 2012
1 answer
83 views
I have a Radgrid on a page that uses GroupByExpressions and for editing a WebUserConrtol.  Everything seems to work fine except when the Edit form is displayed, it pushes everything below it to the right.  See the attachment.  How do I get it to stop altering the main grid?

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Office2007" AllowPaging="false"
     Width="100%" EnableLinqExpressions="true" AllowCustomPaging="false" AutoGenerateColumns="False"
     GridLines="None" AllowSorting="true" AllowFilteringByColumn="false" AlternatingItemStyle-BackColor="#eeeeee"
     ShowGroupPanel="False" ShowStatusBar="True" OnNeedDataSource="RadGrid1_NeedDataSource">
  <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
    <MasterTableView Width="100%" DataKeyNames="DocumentLogID" PagerStyle-Mode="NextPrevNumericAndAdvanced"
         ClientDataKeyNames="DocumentLogID">
       <GroupByExpressions>
         <telerik:GridGroupByExpression>
           <SelectFields>
             <telerik:GridGroupByField FieldAlias="" HeaderText=" " FieldName="AccessPerson" HeaderValueSeparator="" />
           </SelectFields>
           <GroupByFields>
             <telerik:GridGroupByField FieldName="AccessPerson" HeaderText="Access Person" SortOrder="Ascending" />
           </GroupByFields>
         </telerik:GridGroupByExpression>
       </GroupByExpressions>
       <Columns>
         <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
         </telerik:GridEditCommandColumn>
         <telerik:GridTemplateColumn UniqueName="PrintDoc" HeaderText="Print">
            <HeaderTemplate>
              <asp:CheckBox ID="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True"
                   runat="server"></asp:CheckBox>
            </HeaderTemplate>
            <ItemTemplate>
              <asp:CheckBox ID="PrintCheckBox" runat="server" OnCheckedChanged="ToggleRowSelection"
                   AutoPostBack="true" Visible="true"></asp:CheckBox>
            </ItemTemplate>
         </telerik:GridTemplateColumn>
         <telerik:GridBoundColumn DataField="DocumentLogID" Visible="false" UniqueName="DocumentLogID" />
         <telerik:GridBoundColumn DataField="ClientID" Visible="false" />
         <telerik:GridBoundColumn DataField="AccessPersonID" Visible="false" />
         <telerik:GridBoundColumn DataField="ReportID" Visible="false" />
         <telerik:GridBoundColumn SortExpression="ReportName" DataField="ReportName" HeaderText="Report Name" />
         <telerik:GridBoundColumn SortExpression="StatusDescription" DataField="StatusDescription"
                  HeaderText="Status" />
         <telerik:GridBoundColumn DataField="DocumentStatusID" UniqueName="DocumentStatusID"
                  Groupable="False" Visible="False" />
         <telerik:GridBoundColumn SortExpression="SentBy" DataField="SentBy" HeaderText="Sent By"
                  AllowFiltering="false" />
         <telerik:GridBoundColumn SortExpression="DateSent" DataField="DateSent" HeaderText="Date Sent"
                  DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}" AllowFiltering="false" />
         <telerik:GridBoundColumn SortExpression="DueDate" DataField="DueDate" HeaderText="Date Due"
                  DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}" AllowFiltering="false" />
         <telerik:GridBoundColumn SortExpression="PrintReason1" DataField="PrintReason1" HeaderText="Print Reason"
                  AllowFiltering="false" />
         <telerik:GridBoundColumn SortExpression="StartDate" DataField="StartDate" HeaderText="Start Due"
                  DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}" AllowFiltering="false" />
         <telerik:GridBoundColumn SortExpression="EndDate" DataField="EndDate" HeaderText="End Due"
                  DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}" AllowFiltering="false" />
         <telerik:GridBoundColumn SortExpression="Version" DataField="Version" HeaderText="Version"
                  AllowFiltering="false" />
      </Columns>
      <EditFormSettings UserControlName="Controls/PrintDocDetails.ascx" EditFormType="WebUserControl">
        <EditColumn UniqueName="EditCommandColumn1">
          <ItemStyle Width="100%" />
        </EditColumn>
      </EditFormSettings>
   </MasterTableView>
   <ClientSettings>
      <ClientEvents OnRowDblClick="RowDblClick" />
   </ClientSettings>
   <FilterMenu Skin="Office2007" EnableTheming="True">
     <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
   </FilterMenu>
 </telerik:RadGrid>
Eric Klein
Top achievements
Rank 1
 answered on 30 Jan 2012
4 answers
94 views
Hi, i've got a radgrid with some template columns in that contain images.

Although when exporting the images aren't displayed, a missing image icon is displayed in its place. What i'd like to do is at the point of exporting, remove any images in each row if any are present, replacing them, ideally with their alt tag, resulting in just text.


Is this possible ?

Also i'm pretty sure this isn't possible but are you able to include data from another control in the page such as a header for example ?

e.g. i've got a radgrid of hits and their associated item. It'd be nice if i could put some totals in the exported file, which at the moment i'm showing in a seperate table inside a panel.


thanks, Alan
Alan T
Top achievements
Rank 1
 answered on 30 Jan 2012
9 answers
876 views
Hi,

I have used the edit template in the radgrid to create a custom insert/edit form in the grid.
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx

how do I add a select button to the grid and display a custom read-only view in the grid?

Regards
Pavlina
Telerik team
 answered on 30 Jan 2012
2 answers
207 views
Ok, here's my basic problem:

In IE9 the grid looks fine, but if you switch to compatibility mode (IE7 Standards),  it disappears.  I have traced this to a width styling issue.

When rendering in IE9 the table renders as:
<table class="rgMasterTable rgClipCells" id="ctl00_dialogPlaceholder_addRecipientsDialog_allRecipientsGrid_ctl00" style="width: 100%; overflow: hidden; table-layout: fixed; text-overflow: ellipsis; empty-cells: show;" border="0" control="[object Object]">


When rendering in Combatibility mode the table renders as:
<table class="rgMasterTable rgClipCells" id="ctl00_dialogPlaceholder_addRecipientsDialog_allRecipientsGrid_ctl00" style="width: auto; overflow: hidden; table-layout: fixed; text-overflow: ellipsis; empty-cells: show;" border="0" control="[object Object]"><br>

Using IE Developer tools to change the width from auto to 100% resolves the issue.  How can I do this for real for actual clients?  I've tried setting the MasterTableView width to 100%, but that doesn't resolve anything.

 Here is the RadGrid (Telerik.Web.UI.dll version is 2011.2.915.35)

<telerik:RadGrid ID="allRecipientsGrid" Skin="Default" runat="server" EnableAJAX="True" EnableAJAXLoadingTemplate="True" ClientSettings-AllowKeyboardNavigation=false<br>                                        OnNeedDataSource="allRecipientsGrid_NeedDataSource" Width="98%" AllowMultiRowSelection="false"<br>                                        Height="281px" UseEmbeddedScripts="false" RadControlsDir="~/RadControls">
  <
br>                                       
  <
PagerStyle Mode="NextPrev" />
  <
br>                                       
  <
HeaderStyle Font-Bold="true" />
  <
br>                                       
  <
MasterTableView AutoGenerateColumns="false" AllowPaging="false" AllowCustomPaging="false">
    <
br>                                           
    <
RowIndicatorColumn>
      <
br>                                           
    </
RowIndicatorColumn>
    <
br>                                           
    <
Columns>
      <
br>                                               
      <
telerik:GridTemplateColumn>
        <
br>                                                   
        <
HeaderStyle Width="68%"/>
          <
br>
          <
ItemStyle Width="68%"/>
          <
br>                                                   
          <
ItemTemplate>
            <
br>                                                       
              <
span class="recipientObjectTag" style="display: none; visibility: hidden;"><br
                 <%# ((MailRecipient)Container.DataItem).ToJSON() %><
br
              </
span>
              <
label>
                <
input class="chkSelectedUser" type="checkbox" name="selecteduser" value="" onclick="this.value=this.parentNode.previousSibling.innerHTML;" /><br>  
                  <%# ((MailRecipient)Container.DataItem).FullNameShort %><
br>
              </
label><br>                                                   
          </
ItemTemplate><br>                                               
        </
telerik:GridTemplateColumn><br>                                               
        <
telerik:GridTemplateColumn><br>                                                   
          <
HeaderStyle Width="32%" /><br>                                                   
          <
ItemStyle Width="32%" /><br>                                                   
          <
ItemTemplate><br>                                                       
            <%# ((MailRecipient)Container.DataItem).GetTypeName(this.IsCourseContext) %><
br>
          </
ItemTemplate><br>                                               
        </
telerik:GridTemplateColumn><br>                                           
      </
Columns><br>                                       
    </
MasterTableView><br>                                       
    <
ClientSettings><br>                                           
    <
Scrolling AllowScroll="True" UseStaticHeaders="true" SaveScrollPosition="True" /><br>  
    <
Selecting AllowRowSelect="true" /><br>                                           
    <
ClientEvents OnGridCreated="recipientsGridCreated" OnDataBound="recipientsGridRequestEnd" /><br>
    </
ClientSettings><br>                                   
</
telerik:RadGrid>
Matt
Top achievements
Rank 1
 answered on 30 Jan 2012
1 answer
465 views
Hi !!

I am using RadUpload to upload single video file at a time. The code in aspx file is

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
 
        function checkFileExists() {
 
                    var count = 0;
                    var upld = $find('<%= RadUpload1.ClientID %>');
                    var input = $find('<%= RadUpload1.ClientID %>').getFileInputs();
                    var fileName = input[0].value.toLowerCase();
                    var allowOverWriteFile = true;
 
                    //To check whether the selected file is with mp4 extension or not
            if (upld.isExtensionValid(fileName) == false) {
                        alert("You are allowed to upload only MP4 files. Kindly select the MP4 video and upload again.");
                        return false;
                    }
 
            //To confirm overwrite
                    count = document.getElementById('<%= txtUrl.ClientID %>').options.length;
 
                    for (var i = 0; i < count; i++) {
 
                        if (fileName == document.getElementById('<%= txtUrl.ClientID %>').options[i].value.toLowerCase()) {
 
                            allowOverWriteFile = confirm("This file is already exists. Are you sure want to overwrite it?");
                            return allowOverWriteFile;
                        }
                    }
                    return true;
                }
 
    </script>
</telerik:RadScriptBlock>
 
<telerik:RadProgressManager ID="RadProgressManager1" runat="server" Width="245px"/>
<telerik:RadProgressArea ID="RadProgressArea1" runat="server" ProgressIndicators="TotalProgressBar,CurrentFileName,RequestSize,TransferSpeed" Skin="Default" Width="245px" DisplayCancelButton="true">
</telerik:RadProgressArea>
 
<telerik:RadUpload ID="RadUpload1" runat="server" OverwriteExistingFiles="true" ControlObjectsVisibility="None" InitialFileInputsCount="1" AllowedFileExtensions=".mp4" Width="100px" allowedmimetypes="application/mp4,video/mp4">
</telerik:RadUpload>
 
<asp:Button ID="BtnUpload" runat="server" Text="Upload" OnClientClick="return checkFileExists()" onclick="BtnUpload_Click" />


on clicking "BtnUpload" I have logic to save file on server directory.


aspx.cs file is :

protected void BtnUpload_Click(object sender, EventArgs e)
{
            //int counter = 0;
 
            string targetFolder = string.Empty;
            string targetFileNameAndPath = string.Empty;
            string targetFileNameWithExtension = string.Empty;
            string targetFileNameWithoutExtension = string.Empty;
            string tempFilename = string.Empty;
 
            if (RadUpload1.UploadedFiles.Count > 0)
            {
                if (RadUpload1.InvalidFiles.Count > 0)
                {
                    labelInvalidResults.Visible = true;
                }
                else
                {
                     
                    labelInvalidResults.Visible = false;
 
                    targetFolder = Server.MapPath(ResolveUrl("~/directoryName/"));
                    targetFileNameAndPath = Path.Combine(targetFolder, RadUpload1.UploadedFiles[0].GetNameWithoutExtension() + RadUpload1.UploadedFiles[0].GetExtension());
                    targetFileNameWithExtension = RadUpload1.UploadedFiles[0].GetNameWithoutExtension() + RadUpload1.UploadedFiles[0].GetExtension();
                    targetFileNameWithoutExtension = RadUpload1.UploadedFiles[0].GetNameWithoutExtension();
                    tempFilename = targetFileNameWithoutExtension.Replace("_", " ");
 
                    RadUpload1.UploadedFiles[0].SaveAs(targetFileNameAndPath);
 
 
                    Thread uploadVideoThread = new Thread(() => convertVideoFile(targetFileNameAndPath, targetFileNameWithExtension, targetFileNameWithoutExtension));
                    uploadVideoThread.Start();
                     
                }
            }
}


My web.config file is :

<system.web>
    <httpModules>
        <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
    </httpModules>
        <httpRuntime maxRequestLength="102400" executionTimeout="3600" />
</system.web>
 
<system.webServer>
    <modules>
                <add name="RadUploadModule" preCondition="integratedMode" type="Telerik.Web.UI.RadUploadHttpModule" />
        </modules>
    <handlers>
        <add name="Telerik_RadUploadProgressHandler_ashx" verb="*" preCondition="integratedMode" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" />
    </handlers>
</system.webServer>


The problem is I want to cancel the upload process of current file (during uploading process is going on )on clicking "Cancel" button shown in Progressarea. How can be it possible?. At present when user clicks on "cancel" button, it just closes the uploading progress dialog, but still physical file gets uploaded on serverside. It should not be uploaded alt all.

Bozhidar
Telerik team
 answered on 30 Jan 2012
3 answers
112 views
I've encountered a problem with the standard Microsoft ListBox, as described here: http://forums.asp.net/p/1762321/4800943.aspx/1?Re+Getting+Validation+Error+Upon+Update+of+a+ListBox+s+Contents

Note that the first response provided is absolutely incorrect.  The problem apparently occurs when a new item is added to the listbox or an existing item is changed.  BUT THAT'S PRECISELY WHAT I NEED TO DO!!!

Rather than wasting hours/days trying to resolve this problem with the standard ListBox, I thought the easiest solution might just be to use Telerik's ListBox instead.  In anticipation of that, is there any particular approach I should use to updating the ListBox to avoid this dreaded Event Validation error?

Robert
Robert
Top achievements
Rank 1
 answered on 30 Jan 2012
3 answers
217 views

Hi,
I have a dynamic created treeview, each node contains several kinds of user controls. My problem is I can find the "radtextbox" user
control, but I can't find the "checkbox" user control using clientside javascript.

class GrandChildNodeTemplate :ITemplate
{ ...
public void InstantiateIn(Control container)
{

cb.ID = "cb";
cb.Visible = false;
cb.DataBinding += new EventHandler(checkBox_DataBinding);
container.Controls.Add(cb);

rtb.ID = "rtb";
rtb.Visible = false;
rtb.DataBinding += new EventHandler(radTextBox_DataBinding);
container.Controls.Add(rtb);
}
}

page_load
protected void populate(RadTreeNode eNode)
{
GrandChildNodeTemplate grandChildTemplate = new GrandChildNodeTemplate();
RadTreeNode node = new RadTreeNode("gcn");
eNode.Nodes.Add(node);
grandChildTemplate.InstantiateIn(node);

....
cb = (CheckBox)node.FindControl("cb");
cb.Visible = true;
node.Value = thisGuid;
cb.Attributes.Add("onClick", "return findNode('" + thisGuid+ "')");
}

code for clientside

JS += "function findNode(args) { ";
JS += " var tv = $find('"+ rtvReportComponents.ClientID + "'); ";
JS += " var node = tv.findNodeByValue(args);";
JS += " var rtb = node.findControl(\"rtb\"); ";
JS += " if (rtb==null) alert('hello');";
JS += " var cb = node.findControl(\"cb\"); ";
JS += " if (cb==null) alert(args);"; // <--- problem is here. cb==null, can't find checkbox
JS += " if (!cb.checked){";
JS += " rtb.disable();}";
JS += " else{";
JS += " rtb.enable();}";
JS += " }";

ScriptManager.RegisterClientScriptBlock(this, GetType(), "Condition Info", JS, true);

My suspicion is node.findcontrol method can't find the DOM element? Thanks

Bozhidar
Telerik team
 answered on 30 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?