Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
242 views
Hello.

We have a problem.

If I input special character  "<br/>" or "<a>" into RadTextbox and submit data,

server exception error raised  "System.Web.HttpRequestValidationException"

please let me know how can I solve this problem.
Maria Ilieva
Telerik team
 answered on 10 Dec 2012
1 answer
153 views
i have a radGrid that contains a 'Download file' button, that downloads file from server. The grid has a RadAjax Loading panel that shows a loading icon while time consuming operations are being performed.

The Loading icon works in all cases but interferes with Download functionality. when i select download, the loading icon appears indefinitely & after sometime the following error is displayed:

The data necessary to complete this operation is not yet available.

Detailed error:
Sys.WebForms.PageRequestManagerParserErrorException: 
The message received from the server could not be parsed. Common causes for this error are when the response
 is modified by calls to Response.Write(), 
+response filters, HttpModules, or server trace is enabled.

Following is my code:


////////////////////////////This is for RadAjax Loading panel//////////////

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function centerLoadingPanel()
             {                
                  centerElementOnScreen($get("<%= RadAjaxLoadingPanel1.ClientID %>"));
             }
           function centerElementOnScreen(element)
            {
               var scrollTop = document.body.scrollTop;
                var scrollLeft = document.body.scrollLeft;
                var viewPortHeight = document.body.clientHeight;
                var viewPortWidth = document.body.clientWidth;
                if (document.compatMode == "CSS1Compat") {
                    viewPortHeight = document.documentElement.clientHeight;
                    viewPortWidth = document.documentElement.clientWidth;
                   if (!$telerik.isSafari) {
                        scrollTop = document.documentElement.scrollTop;
                        scrollLeft = document.documentElement.scrollLeft;
                    }
               }
                var topOffset = Math.ceil(viewPortHeight / 2 - element.offsetHeight / 2);
                var leftOffset = Math.ceil(viewPortWidth / 2 - element.offsetWidth / 2);
                var top = scrollTop + topOffset - 40;
                var left = scrollLeft + leftOffset - 70;
                element.style.top =  "0px";
                element.style.left = "0px";
                var loadingImage = document.getElementById('<%= RadAjaxLoadingPanel1.FindControl("Image11").ClientID %>');
                loadingImage.style.left = "100px";
            }
            function RequestStart(sender, eventArgs) 
            {
               
                var loadingImage = document.getElementById('<%= RadAjaxLoadingPanel1.FindControl("Image11").ClientID %>');
                var panel1 = $get("<%= PagerPanel.ClientID %>");
                           if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
                    $get("<%= RadAjaxLoadingPanel1.ClientID %>").style.height = document.documentElement.scrollHeight + "px";
                }
            }
         
        </script>
    </telerik:RadCodeBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<ClientEvents OnRequestStart="centerLoadingPanel()"  />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="PagerPanel" >          
                <UpdatedControls >
                    <telerik:AjaxUpdatedControl  ControlID="PagerPanel" LoadingPanelID="RadAjaxLoadingPanel1"  UpdatePanelHeight="100%" UpdatePanelRenderMode="Block"  ></telerik:AjaxUpdatedControl>
                </UpdatedControls>               
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"  Transparency="0"  EnableSkinTransparency="false" Direction="LeftToRight" ZIndex="-1"    BackgroundPosition="Center"   IsSticky="true" CssClass="MyModalPanel" Height="100%"   >
                    <div class="loading">
                     <table  style=" background-color:White; color:White;height:150px; width:311px; vertical-align:middle " >
                         <tr align="center" >
                             <td align="center" >
                                <img src="~/images/XS-Docs_WaitAnimation.gif"  id="Image11" runat="server" alt="img"  />               
                             </td>
                         </tr>
                     </table>
                   </div>
    </telerik:RadAjaxLoadingPanel>


//////////////////////////THis is for Download file code///////////////////

   public bool DownloadFile(string methodname, object[] obj)
        {
            string URi = ConfigurationManager.AppSettings["ServiceURL"].ToString();
           
            WebClient proxy = new WebClient();

            byte[] abc = proxy.DownloadData((new Uri(URi)));
            
            MemoryStream strm = new MemoryStream(abc);

            if (abc.Length > 0)
            {
                string _DownloadableProductFileName = obj[2].ToString();
                BinaryReader _BinaryReader = new BinaryReader(strm);
                long startBytes = 0;
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Buffer = false;
                HttpContext.Current.Response.AddHeader("Accept-Ranges", "bytes");
                //Set the ContentType

                string Content_Type = "";
                if (obj[1].ToString() == "PDF")
                    Content_Type = "application/pdf";
           
                HttpContext.Current.Response.ContentType = Content_Type;

                //Add the file name and attachment, 
                //which will force the open/cancel/save dialog to show, to the header
                HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + _DownloadableProductFileName);

                //Add the file size into the response header
                HttpContext.Current.Response.AddHeader("Content-Length", (strm.Length - startBytes).ToString());
                HttpContext.Current.Response.AddHeader("Connection", "Keep-Alive");

                //Set the Content Encoding type
                HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;

                //Send data
                _BinaryReader.BaseStream.Seek(startBytes, SeekOrigin.Begin);
                int maxCount = (int)Math.Ceiling((strm.Length - startBytes + 0.0) / 1024);
                int i;
                for (i = 0; i < maxCount && HttpContext.Current.Response.IsClientConnected; i++)
                {
                    HttpContext.Current.Response.BinaryWrite(_BinaryReader.ReadBytes(1024));
                    HttpContext.Current.Response.Flush();
                }

                _BinaryReader.Close();
                if (i < maxCount)
                    return false;
                else
                    return true;
                
            }
            else
            {
                return false;
            }
           
        }
/////////////////////////////////End///////////////////////////////////////


Maria Ilieva
Telerik team
 answered on 10 Dec 2012
2 answers
106 views
When selecting all text and applying a different alignment (left, right, center, justify) an empty paragraph is added after each element. This happens in Internet Explorer 9.

We are using version 2012.3.1016.45 of the editor, but the same problem happens with the online demo of the editor.

Example:
We have the following HTML-code in the texteditor:

<h1>Lorem Ipsum</h1>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur fermentum vestibulum elit nec rhoncus.</p>
<p>Duis urna elit, porttitor vel luctus vitae, suscipit dapibus nisi. Maecenas vulputate dapibus malesuada. Sed ut erat eget elit vulputate tincidunt. Sed in quam congue erat pulvinar.</p>
<p>Fusce non ligula et neque placerat dictum. Vivamus consectetur diam quis enim porta eget commodo justo interdum. Morbi id nisi eget nisi egestas dictum non in est. Praesent dignissim dolor non lorem faucibus pellentesque. Vivamus imperdiet cursus enim ut luctus. Morbi hendrerit suscipit turpis, ut sollicitudin erat auctor vitae.</p>
<p>In eget nisi sit amet metus semper bibendum:</p>
<ul>
    <li>Cras purus </li>
    <li>Lacinia id conseqat </li>
    <li>Gravida ut metus </li>
    <li>Pellentesque interdum </li>
    <li>Cras fermentum fringilla enim tincidunt </li>
    <li>Duis porttitor </li>
    <li>...</li>
</ul>
<p> </p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis.</p>

Then we do CTRL-A to select all the text and click the button to change the alignment (center, right or justify).

In Google Chrome we get this correct result:

<h1 style="text-align: justify;">Lorem Ipsum</h1>
<h4 style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
<p style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur fermentum vestibulum elit nec rhoncus.</p>
<p style="text-align: justify;">Duis urna elit, porttitor vel luctus vitae, suscipit dapibus nisi. Maecenas vulputate dapibus malesuada. Sed ut erat eget elit vulputate tincidunt. Sed in quam congue erat pulvinar.</p>
<p style="text-align: justify;">Fusce non ligula et neque placerat dictum. Vivamus consectetur diam quis enim porta eget commodo justo interdum. Morbi id nisi eget nisi egestas dictum non in est. Praesent dignissim dolor non lorem faucibus pellentesque. Vivamus imperdiet cursus enim ut luctus. Morbi hendrerit suscipit turpis, ut sollicitudin erat auctor vitae.</p>
<p style="text-align: justify;">In eget nisi sit amet metus semper bibendum:</p>
<ul>
    <li style="text-align: justify;">Cras purus </li>
    <li style="text-align: justify;">Lacinia id conseqat </li>
    <li style="text-align: justify;">Gravida ut metus </li>
    <li style="text-align: justify;">Pellentesque interdum </li>
    <li style="text-align: justify;">Cras fermentum fringilla enim tincidunt </li>
    <li style="text-align: justify;">Duis porttitor </li>
    <li style="text-align: justify;">...</li>
</ul>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis.</p>
<div style="text-align: justify;"><br />
</div>

In Internet Explorer 9, an empty paragraph is added after each element:

<h1 style="text-align: justify;">Lorem Ipsum</h1>
<p style="text-align: justify;">
</p>
<h4 style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur fermentum vestibulum elit nec rhoncus.</p>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">Duis urna elit, porttitor vel luctus vitae, suscipit dapibus nisi. Maecenas vulputate dapibus malesuada. Sed ut erat eget elit vulputate tincidunt. Sed in quam congue erat pulvinar.</p>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">Fusce non ligula et neque placerat dictum. Vivamus consectetur diam quis enim porta eget commodo justo interdum. Morbi id nisi eget nisi egestas dictum non in est. Praesent dignissim dolor non lorem faucibus pellentesque. Vivamus imperdiet cursus enim ut luctus. Morbi hendrerit suscipit turpis, ut sollicitudin erat auctor vitae.</p>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">In eget nisi sit amet metus semper bibendum:</p>
<p style="text-align: justify;">
</p>
<ul>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Cras purus </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Lacinia id conseqat </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Gravida ut metus </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Pellentesque interdum </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Cras fermentum fringilla enim tincidunt </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Duis porttitor </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">...</div>
    </li>
    <p style="text-align: justify;">
    </p>
</ul>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis.</p>
Roelande
Top achievements
Rank 1
 answered on 10 Dec 2012
2 answers
135 views
Hi, I'm using RadTimePicker (really i'm using DnnTimePicker, but it's the same)  in my dotnetnuke proyect.
RadTimePicker works fine, but i found a little problem.
I have the proyect in a server, if I set the mindate value for example to today at 11:00, then the  RadTimePicker mindate value is "4/12/2012 11:00". This "today" uses the server date.

Ok, its ok, if I open the solution in a client machine with the same date, all works fine, i can't select any hours before mindate.

But i think that mindate validation uses client machine "today" for compare with RadTimePicker mindate. Then if client machine has a different date, for example, 5/12/2012, if I select for example 10:00, mindate validation will compare mindate (4/12/2012 11:00) and selected date (5/12/2012 10:00) and like

4/12/2012 11:00 < 5/12/2012 10:00

I will can select this hour.

I'm not sure that this, because, If client machine has a previous date to server machine date (for example 3/12/2012), in my theory, if i select 12:00, "mindate validation" will compare:

4/12/2012 11:00 < 3/12/2012 12:00

but this doesn't happen, it's like only compares 11:00 < 12:00 and permits to select this.

I don't understand how works this validation, but one thing is sure:

- Client machine with the same o previous date that server machine: all works ok.
- Client machine with a bigger date: this don't work.


I hope that you can help me :)

Thanks, regards, Javi.

PD: sorry for my english
Javi
Top achievements
Rank 1
 answered on 10 Dec 2012
1 answer
76 views
i have radcombo with emptymessage even though not selecting any value it is postbacking....

my code is

 

 

<telerik:RadComboBox ID="Commodity" AppendDataBoundItems="true" EmptyMessage="--Select--"

 

 

 

Width="80px" runat="server" CheckBoxes="true" DropDownWidth="150px" AutoPostBack="true" EnableCheckAllItemsCheckBox="true"

 

 

 

CheckedItemsTexts="DisplayAllInInput" OnSelectedIndexChanged="gvNetExposurefilter_SelectedIndexChanged">

 

 

 

</telerik:RadComboBox>

 

Kalina
Telerik team
 answered on 10 Dec 2012
4 answers
421 views
I'm using the EnableAutomaticLoadOnDemand with a RadComboBox, the EntityDataSource is defined in code behind and connected with the RadComboBox.

When I open the DropDown of the RadComboBox I get this error:

Object reference not set to an instance of object

There is an example of how to define a datasource in the code behind in this case? Is possible using EnableAutomaticLoadOnDemand?

Alberto


saeed
Top achievements
Rank 1
 answered on 10 Dec 2012
10 answers
185 views
Is it possible to change the start time 12:00AM to "Open"  and end time 12:00AM to close on the picker?
Princy
Top achievements
Rank 2
 answered on 10 Dec 2012
1 answer
143 views
Hi,
We are using having parent child hierarchical Telerik Grid. The grid is containing large number of records(77506 items in 7751 pages).After 2-3 mins,after clicking the Export to Excel button, It's throwing Exception as "Exception of type 'System.OutOfMemoryException' was thrown."



Using the below code for Export to Excel button click event.

gviewAuditTrial.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerBind;
            gviewAuditTrial.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
            gviewAuditTrial.ExportSettings.IgnorePaging = true;
            gviewAuditTrial.ExportSettings.OpenInNewWindow = true;
            gviewAuditTrial.ExportSettings.FileName = "CRF_Details";
            gviewAuditTrial.ExportSettings.ExportOnlyData = true;
            gviewAuditTrial.MasterTableView.ExportToExcel();

Please let me know the solution for this.

Thanks,
Prasad
Prasad@magnasys.net


Shinu
Top achievements
Rank 2
 answered on 10 Dec 2012
3 answers
142 views
Dear friends, I found may threads but none of them worked for me. what I'm trying to do is:

main page (with masterpage) will call page1 in radwindow
o page1, I need to close radwindow and sense its closed so I'll go on...

problem is, I could not find main page's radwindow control and cannot close it. can you help me ?

on main page I open as:
<telerik:radwindowmanager id="RadWindowManager1" reloadonshow="true" runat="server">
        <Windows>
            <telerik:RadWindow runat="server" Width="600px" Height="550px" VisibleStatusbar="true" Style="z-index: 10000;"
                ID="ExplorerWindow" Modal="true" Behaviors="Default" ShowContentDuringLoad="true" RegisterWithScriptManager="true" >
            </telerik:RadWindow>
        </Windows>
    </telerik:radwindowmanager>
 
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    ExplorerWindow.NavigateUrl = "page1.aspx"
    ExplorerWindow.VisibleOnPageLoad = True
End Sub

I dont know howto find radwindow from the page inside radwindow.

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
 
    ' close window
 
End Sub

there's nothing in pages as this is isolated test application. just trying to close radwindow.
thanks...

Princy
Top achievements
Rank 2
 answered on 10 Dec 2012
1 answer
176 views
'AjaxControlToolkit.NumericUpDownExtender' cannot extend controls of type 'Telerik.Web.UI.RadNumericTextBox'..How to use
 'Telerik.Web.UI.RadNumericTextBox' with numeric updown extender
Princy
Top achievements
Rank 2
 answered on 10 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?