Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
277 views
error the requested url returned 500 error
hi i have used ajax gridview..after updating sometime it is showing above error and some times json did not return requested url  error....before loading from a particular controller two times it is coming to the controller..
please help me out....i have read your documents nothing worked for me...
Iana Tsolova
Telerik team
 answered on 28 Jun 2011
1 answer
83 views
Is there any plans for a asp.net ajax map control? I know google maps is widely used but it would be nice to have something similar to the silverlight map control in asp.net.
Sebastian
Telerik team
 answered on 28 Jun 2011
3 answers
510 views
Hi,

I have grid with GridEditCommandColumn and OnItemDataBound i am adding Javascript on this GridEditCommandColumn but nothing happening. Can anyone tell what i am doing wrong ? Following is my code
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditImageUrl="~/Images/Edit.gif"
                                        ButtonType="ImageButton">
                                    </telerik:GridEditCommandColumn>
 
if (e.Item is GridDataItem)
           {
               GridDataItem item = (GridDataItem)e.Item;
               ImageButton edit = (ImageButton)item["EditCommandColumn"].Controls[0];
               //edit.Attributes.Add("OnClick", " onContactRowSelected('" + sender + "','" + e + "');");
               edit.Attributes["onClick"] = "alert('test');return false;";
           }


One more thing my Grid has following thing as well
<ClientEvents OnCommand="radContactGrid_Command" OnRowCreated="onContactGridRowCreated"
                                    OnRowCreating="onContactGridRowCreating" OnRowSelected="onContactRowSelected" />



Thanks,
--Jai
Tsvetoslav
Telerik team
 answered on 28 Jun 2011
3 answers
55 views
Hai,

I have a Radwindow like this :

<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
                                                        ReloadOnShow="true" runat="server" Skin="Web20" Style="z-index: 20002" >
                                                        <Windows >
                                                            <telerik:RadWindow ID="RadWindowPopup"
                                                                EnableShadow="true" DestroyOnClose="true" Visible="true"
                                                                Behaviors="Resize, Close, Maximize"
                                                                VisibleOnPageLoad="false" runat="server" Title="Local Item Request" Skin="Web20">
                                                            </telerik:RadWindow>
                                                        </Windows>
                                                       
                                                    </telerik:RadWindowManager>

In Code behind, I have called this radwindow like this :

if (!ClientScript.IsStartupScriptRegistered("popupWindow"))
                     System.Web.UI.ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "popupWindow", "showWindow();", true);

showWindow() javascript is

 

function showWindow() {

 

 

var varMealOrderID = document.getElementById('ctl00_CphMaster_hidMealOrderId').value;

 

 

var oWnd = radopen('FKMS_CTRL_Local_Item_Request.aspx?MealOrderId=' + varMealOrderID + '&popup=true' + '&Mode=NEW', 'RadWindowPopup');

 

oWnd.setSize(1100, 750);

oWnd.moveTo(75, 50);

 

}


This code works fine in my local development computer. But When I hosted in a server, it is showing the following javascript error in the radopen portion of showWindow() method.

Microsoft JScript runtime error: Object doesn't support this property or method

Please help me.
Marin Bratanov
Telerik team
 answered on 28 Jun 2011
5 answers
336 views
Hi all:
    I try to display the file ( txt, image , PDF , word..etc format) using tooltip. ( just like the sameple
http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultvb.aspx)

the issue is that when I mouse over the record, I got the following error : "RadTootipManager response error. ...the message received from server could not parsed..."

what I did is to read the files then use the response.write to generate the file content.please see code below:

'on parent page which has tooltip with it
  
    Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
        Dim ctrl As Control = Page.LoadControl("WidgetControls/WidgetSupportDocument.ascx")
        panel.ContentTemplateContainer.Controls.Add(ctrl)
        Dim details As WidgetSupportDocument = DirectCast(ctrl, WidgetSupportDocument)
        details.SupportDocumentID = elementID
        details.DisplayData()
  
    End Sub


on WidgetSupportDocument.ascx control:
Public Sub DisplayData()
      Dim dsData As DataSet
      Dim strFileName As String
      Dim byteData() As Byte
      Dim strDocumentType As String
      Dim arrSplit() As String
      'load data from database
      dsData = LoadData(Me.SupportDocumentID)
      byteData = CType(dsData.Tables(0).Rows(0).Item("FileContent"), Byte())
      arrSplit = Split(dsData.Tables(0).Rows(0).Item("Filename").ToString, ".")
      intLastValue = arrSplit.Length
      strDocumentType = arrSplit(intLastValue - 1)
      SetControlData(strDocumentType, byteData)
  End Sub
  Private Sub SetControlData(ByVal strDocumentType As String, ByVal byteView() As Byte, Optional ByVal strFileName As String = "")
      Dim strContentType As String = String.Empty
      Select Case UCase(strDocumentType)
          Case "HTML", "HTM"
              strContentType = "text/HTML"
          Case "BMP"
              strContentType = "image/BMP"
          Case "JPG"
              strContentType = "image/JPEG"
          Case "GIF"
              strContentType = "image/GIF"
          Case "PDF"
              strContentType = "application/pdf"
          Case "XLS"
              strContentType = "application/vnd.ms-excel"
          Case "DOC"
              strContentType = "application/msword"
          Case "TXT", "LOG"
              ' .txt file (such as a report tab delimited export) should open inline rather then directly in the browser 
              If strFileName = "" Then
                  strFileName = "ViewDocument.txt"
              End If
              With Response
                  .ClearContent()
                  .ClearHeaders()
                  strContentType = "text/unknown"
                  .AddHeader("Content-Length", CType(byteView.Length, String))
                  .AddHeader("Content-Disposition", "inline; filename=" & strFileName)
              End With
          Case Else
      End Select
      If strContentType.Length > 0 Then
          With Response
              .Clear()
              .ContentType = strContentType
              .BinaryWrite(byteView)
              .Flush()
          End With
      Else
          Response.Write("<font color='red'>The selected attachement cannot be displayed. </font>")
                End If
  End Sub


Thanks
Helena
Marin Bratanov
Telerik team
 answered on 28 Jun 2011
1 answer
135 views
Hi,

We are using Q3 2010 and have a RadImage control that is throwing the following error - but only on production.

Exception information:
Exception type: ArgumentException
Exception message: The provided binary data may not be valid image or may contains unknown header

If I debug the same image in development, no errors are displayed/thrown. Our production environment and development operate in integrated mode and have the following handler entry

      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />

The error only occurs for a handful of images, but when it happens, it brings the entire page down. How can I test whether the data coming from sql is a valid image and catch this condition ahead of time? I have a try catch surrounding everything, but it does not appear to have an impact. I am guessing that the image control is outputting content that ends up corrupting the html output. Any thoughts welcome.
Iana Tsolova
Telerik team
 answered on 28 Jun 2011
1 answer
37 views
My issue is that when I modify my aspx page, ranging anything from adding a div tag to a simple br tag, it will result in the design view hiding all controls of my page, and it's master page. The only thing that would remain visible is the main master page.

My setup:

MenuMaster.master
-> NavBar.master
-> default.aspx

I am running VS2010 version 10.0.303019.1 with RadControls for ASP.NET AJAX version 2011.1.519 
Vasil
Telerik team
 answered on 28 Jun 2011
1 answer
71 views
Please consider this request for a new feature to be added to the RadComboBox. We would like to see a property called "Mode" added. It would have two options; Normal and Label. The default value would be Normal as to not break previous implementations.

Use Case:

When using a RadComboBox on a FormView with view/edit/insert/delete functions, there is no easy way to show the selected item text of the RadComboBox in a Label look & feel without complex JavaScript/CSS or adding code. It would be awesome if we could just set a property called Mode="Label" which caused the RadComboBox to display a Label instead of the combobox. It would use the same css as the rest of the labels on the page. When in Label mode, the control presented to the user would not allow the user to change any values, nor see any look & feel of a combobox. The user would see it as a standard label. 

Currently, we have to put both a label and a combobox in our item template of the FormView. Then set combobox visible=false, and add a SelectionChanged event to the combobox (we use binding) which sets the text value of the label. Lot's of work and extra code just so we can show the user the value of the combobox in Label format! We tried the JavaScript/CSS method, but had other issues and was not sure it would interfere with our other CSS changes in the future. 

Thank you for the consideration.
Kalina
Telerik team
 answered on 28 Jun 2011
1 answer
133 views
Hi,

in an scenario with a master page with the Radajaxmanager control and a content page with a grid i never get the Ajaxrequestdelegate event reach, in this case RadAjaxManager1_AjaxRequest, thanks a lot

the code behind of the content page:

       protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadAjaxManager AjaxManager = (RadAjaxManager)this.Master.FindControl("RadAjaxManager1");
                //                RadAjaxManager AjaxManager = RadAjaxManager.GetCurrent(Page);
                AjaxManager.AjaxSettings.AddAjaxSetting(AjaxManager, RadGridClientes);
                AjaxManager.AjaxSettings.AddAjaxSetting(RadGridClientes, RadGridClientes);
                AjaxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);
            }

        }

        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                RadGridClientes.MasterTableView.SortExpressions.Clear();
                RadGridClientes.MasterTableView.GroupByExpressions.Clear();
                RadGridClientes.Rebind();
            }
            else if (e.Argument == "RebindAndNavigate")
            {
                RadGridClientes.MasterTableView.SortExpressions.Clear();
                RadGridClientes.MasterTableView.GroupByExpressions.Clear();
                RadGridClientes.MasterTableView.CurrentPageIndex = RadGridClientes.MasterTableView.PageCount - 1;
                RadGridClientes.Rebind();
            }
        }

in the content page aspx file:


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">



    <telerik:RadGrid ID="RadGridClientes" runat="server">
    </telerik:RadGrid>

                <telerik:RadButton Text="Cancelar" runat="server" ID="Cancelar" OnClientClicked="refreshGrid">
                </telerik:RadButton>

   <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function refreshGrid(arg) {
            if (!arg) {
                $find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest("Rebind");
            }
            else {
                $find("<%= RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest("RebindAndNavigate");
            }
        }
    
    </script>
    </telerik:RadCodeBlock>
</asp:Content>
Genti
Telerik team
 answered on 28 Jun 2011
1 answer
149 views
I have looked at every example I could find on client-side binding the RadGrid with virtual scrolling and I cannot make it work.
I am using the following Javascript code for binding.
var grid = $find("radgrid1");
                    var mtv = grid.get_masterTableView();
                    mtv.set_dataSource(DATA); //data is coming from a JSON object
                    mtv.dataBind();

What usually happens, is that all of the data in my dataObject is loading and since there are a large number of records the browser freezes. I've tried to use the DataBinding events for the client-side and server side, but they never seem to fire.
I can't use a webservice for this issue.

Thanks.
Shinu
Top achievements
Rank 2
 answered on 28 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?