This is a migrated thread and some comments may be shown as answers.

Ajax and mono

5 Answers 147 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Yann
Top achievements
Rank 1
Yann asked on 07 Oct 2009, 02:57 PM
Hi all,

I need your support to make ajax application on mono.
Here is my configuration :
  • Telerik RadControls .NET 2.0 Q1 2009
  • Mono 2.4 on vmware 2.4.2.3 Suse Linux with Firefox

I try to run one of Telerik demos (AjaxifyTimer) on mono but Ajax callbacks are not performed and I've got the error in the Firefox console (or in IE console) :

Error: [Exception... "'Sys.WebForms.PageRequestManagerParserErrorException: 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.  
 
Details: Error parsing near '<!DOCTYPE html PUBLI'.' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "<unknown>"  data: no] 

I don't understand what is the mistake as I try to run your demo on my Mono, without changing anything in the code.
So is it a problem with mono configuration ?
Or in the Web.config ?
How do you do to make run your demos on your mono server ?
What are the requirements and configuration ?
Thanks for your help.


Here is the code for Default.aspx page :
<%@ Page AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TestManager._Default" %> 
 
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
    Namespace="System.Web.UI" TagPrefix="asp" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/DTD/xhtml11.dtd"> 
<html> 
    <head id="Head1" runat="server">  
    </head> 
    <body class="BODY">  
        <form runat="server" id="mainForm" method="post" style="WIDTH:100%">  
            <!-- content start --> 
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="Timer1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="LoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                    <telerik:AjaxSetting AjaxControlID="btnUp">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="Panel1" /> 
                            <telerik:AjaxUpdatedControl ControlID="lblInterval" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                    <telerik:AjaxSetting AjaxControlID="btnDown">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="Panel1" /> 
                            <telerik:AjaxUpdatedControl ControlID="lblInterval" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
            <div style="float:left;">  
               <telerik:RadGrid id="RadGrid1" runat="server" Skin="Sunset" Width="400px" OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="RadGrid1_NeedDataSource">  
                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="Change" TableLayout="Fixed">  
                        <Columns> 
                            <telerik:GridBoundColumn DataField="Index" HeaderText="Index" UniqueName="Index"></telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Value" HeaderText="Value" DataFormatString="{0:C2}" UniqueName="Value"></telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Change" HeaderText="Change" DataFormatString="{0:P2}" UniqueName="Change"></telerik:GridBoundColumn> 
                            <telerik:GridTemplateColumn UniqueName="TemplateColumn">  
                                <HeaderStyle Width="40px" /> 
                                <ItemTemplate> 
                                    <asp:Image id="Image1" AlternateText="progress" BorderWidth="0px" runat="server"></asp:Image> 
                                </ItemTemplate> 
                            </telerik:GridTemplateColumn> 
                        </Columns> 
                    </MasterTableView> 
                </telerik:RadGrid> 
            </div> 
            <div style="float:right;width:300px;height:117px;padding:10px;font-size:1.1em" class="RadGrid_Sunset">  
                <asp:Label ID="Label1" runat="server" Text="Increase/decrease the timer interval (in millis) through the image buttons below:" ForeColor="Maroon"></asp:Label> 
                <br /> 
                <br /> 
                <asp:ImageButton ID="btnUp" runat="server" ToolTip="increase interval" ImageUrl="Img/image1.gif" /> 
                &nbsp;  
                <asp:ImageButton ID="btnDown" runat="server" ToolTip="decrease interval" ImageUrl="Img/image2.gif" /> 
                <br /> 
                <br /> 
                Timer interval: <asp:Label ID="lblInterval" runat="server" Text="3000" style="font-weight:bold;"></asp:Label> 
            </div> 
            <asp:Panel ID="Panel1" runat="server">  
                <asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer1_Tick" /> 
            </asp:Panel> 
            <!-- content end --> 
        </form> 
    </body> 
</html> 

The code behind is :
Imports Telerik.Web.UI  
 
Partial Public Class _Default  
    Inherits System.Web.UI.Page  
 
    Public Sub Timer1_Tick(ByVal sender As ObjectByVal e As EventArgs) Handles Timer1.Tick  
        RadGrid1.Rebind()  
    End Sub 
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource  
        Dim table As New DataTable()  
        table.Columns.Add("Index"GetType(String))  
        table.Columns.Add("Value"GetType(Double))  
        table.Columns.Add("Change"GetType(Double))  
 
        Dim r As New Random()  
 
        table.Rows.Add(New Object() {"Composite", r.[Next](7000, 8000), r.[Next](-50, 500) / 100})  
        table.Rows.Add(New Object() {"Energy", r.[Next](8000, 9000), r.[Next](-50, 50) / 100})  
        table.Rows.Add(New Object() {"Financial", r.[Next](7000, 8000), r.[Next](-50, 50) / 100})  
        table.Rows.Add(New Object() {"Health care", r.[Next](5000, 6000), r.[Next](-50, 50) / 100})  
 
        RadGrid1.DataSource = table  
 
        System.Threading.Thread.Sleep(500)  
    End Sub 
 
    Protected Sub RadGrid1_ItemDataBound(ByVal sender As ObjectByVal e As GridItemEventArgs) Handles RadGrid1.ItemDataBound  
        If TypeOf e.Item Is GridDataItem Then 
            Dim item As GridDataItem = TryCast(e.Item, GridDataItem)  
            Dim img As System.Web.UI.WebControls.Image = DirectCast(item.FindControl("Image1"), System.Web.UI.WebControls.Image)  
 
            Dim val As Double = DirectCast(item.GetDataKeyValue("Change"), Double)  
            If val > 0 Then 
                img.ImageUrl = "Img/image1.gif" 
                img.AlternateText = "increase" 
            Else 
                img.ImageUrl = "Img/image2.gif" 
                img.AlternateText = "decrease" 
            End If 
        End If 
    End Sub 
 
    Protected Sub btnUp_Click(ByVal sender As ObjectByVal e As ImageClickEventArgs) Handles btnUp.Click  
        Dim newValue As Integer = Timer1.Interval + 1000  
        Timer1.Interval = newValue  
        lblInterval.Text = newValue.ToString()  
    End Sub 
 
    Protected Sub btnDown_Click(ByVal sender As ObjectByVal e As ImageClickEventArgs) Handles btnDown.Click  
        Dim newValue As Integer = Timer1.Interval - 1000  
        Timer1.Interval = newValue  
        lblInterval.Text = newValue.ToString()  
    End Sub 
 
End Class 

And the Web.config is :

<?xml version="1.0" encoding="utf-8"?>  
<configuration> 
 
  <connectionStrings/> 
  <system.net> 
    <connectionManagement> 
      <add address="*" maxconnection="40"/>  
    </connectionManagement> 
    <defaultProxy> 
      <proxy usesystemdefault="True" autoDetect="True" bypassonlocal="True"/>  
    </defaultProxy> 
  </system.net> 
  <system.web> 
    <!--   
            Definissez compilation debug="true" pour inserer des symboles   
            de debogage dans la page compilee. Comme ceci   
            affecte les performances, definissez cette valeur en utilisant true uniquement   
            lors du developpement.  
 
            Options Visual Basic :  
            Definissez strict="true" pour interdire les conversions de types de donnees   
            susceptibles d'entraîner des pertes de donnees.   
            Definissez explicit="true" pour forcer la declaration de toutes les variables.  
        --> 
    <compilation debug="true" strict="true" explicit="true">  
      <assemblies> 
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>  
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>  
        <add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>  
 
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
      </assemblies> 
    </compilation> 
    <pages> 
      <namespaces> 
        <clear/> 
        <add namespace="System"/>  
        <add namespace="System.Collections"/>  
        <add namespace="System.Collections.Specialized"/>  
        <add namespace="System.Configuration"/>  
        <add namespace="System.Text"/>  
        <add namespace="System.Text.RegularExpressions"/>  
        <add namespace="System.Web"/>  
        <add namespace="System.Web.Caching"/>  
        <add namespace="System.Web.SessionState"/>  
        <add namespace="System.Web.Security"/>  
        <add namespace="System.Web.Profile"/>  
        <add namespace="System.Web.UI"/>  
        <add namespace="System.Web.UI.WebControls"/>  
        <add namespace="System.Web.UI.WebControls.WebParts"/>  
        <add namespace="System.Web.UI.HtmlControls"/>  
        <add namespace="Telerik.Web.UI"/>  
      </namespaces> 
    </pages> 
    <httpHandlers> 
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" /> 
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>  
    </httpHandlers> 
 
    <httpModules> 
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>  
 
    </httpModules> 
    <!--  
            La section <authentication> permet la configuration   
            du mode d'authentification de securite utilise par   
            ASP.NET pour identifier un utilisateur entrant.   
        --> 
    <authentication mode="Windows"/>  
    <!--  
            La section <customErrors> permet de configurer   
            les actions a executer si/quand une erreur non geree se produit   
            lors de l'execution d'une demande. Plus precisement,   
            elle permet aux developpeurs de configurer les pages d'erreur html   
            pour qu'elles s'affichent a la place d'une trace de la pile d'erreur.  
 
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">  
            <error statusCode="403" redirect="NoAccess.htm" /> 
            <error statusCode="404" redirect="FileNotFound.htm" /> 
        </customErrors> 
        --> 
    <globalization culture="fr-FR" requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="ISO-8859-1"/>  
  </system.web> 
</configuration> 

5 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Oct 2009, 11:51 AM
Hello Yann,

I created a runnable demo based on the provided code snippets. Please test it locally and let me know whether it's working as expected on your end. Have in mind that I replaced your web.config and modified the AJAX settings.
mono-ajax.zip

Best regards
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
SUNIL
Top achievements
Rank 2
Iron
answered on 12 Mar 2018, 06:36 AM

Hello Daniel,

It seems from your answer that ASP.Net AJAX controls will work in Linux if I use Mono as the IDE. Is this true?

Thanks

Sunil

1
Marin Bratanov
Telerik team
answered on 12 Mar 2018, 08:23 AM
Hi Sunil,

This post is from almost a decade ago. There was, indeed, some effort into supporting the Mono implementation that existed at the time. In later years there was no demand for that and the Mono project itself was abandoned, and so we dropped the initiative and the Mono support. It seems that the Mono project may have been renewed, yet we do not support it anymore. Perhaps some (or even all) things will work, but we have not tested that and we cannot guarantee compatibility.

If you are looking into hosting a web app under Linux, I can suggest you take a look at .NET Core and its Linux support. We also offer controls for MVC Core (wrappers over the Kendo jQuery widgets), so you may find that useful as well.


Regards,
Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
SUNIL
Top achievements
Rank 2
Iron
answered on 12 Mar 2018, 09:09 AM

Yes, I thought so.

Even in latest version of Mono, it says it supports ASP.NET Ajax and a handful of controls, so the Mono webforms implementation is not as complete as its Windows counterpart.

0
Marin Bratanov
Telerik team
answered on 12 Mar 2018, 09:14 AM
It seems that ways, indeed.

I do hope that this information will help you make an informed decision. Let me know if you need anything else from us on this subject.

--Marin

Tags
Ajax
Asked by
Yann
Top achievements
Rank 1
Answers by
Daniel
Telerik team
SUNIL
Top achievements
Rank 2
Iron
Marin Bratanov
Telerik team
Share this question
or