[Mono-aspnet-list] System.InvalidCastException with ScriptManager

ornitorrinc ornitorrinc at gmail.com
Tue Feb 16 04:16:08 EST 2010

Hello everybody,

I am attempting to create a small test site using Mono and AJAX to test
ExtJS_Extender_Controls, with:
- Mono 2.6.1
- VS 2008
- Mono Tools 1.0
- ExtJs Extender Controls 3.3.0

The only page it has is:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="Default" %>
<%@ Register Assembly="ExtExtenders" Namespace="ExtExtenders"
TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
        function renderRating(val){
            if(val > 8){
                return String.format('{0}',val);
                return String.format('{0}',val);

        function DoClient() {
            alert("Menu clicked");
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <div style="position:relative;top:20px;left:30px">
         <cc1:YuiGrid  ID="YuiGrid1"  AutoGenerateColumns="True"
                Width="550px" EnablePaging="True" PagingStyle="NavBar"
                AutoPostBack="true" CheckboxSelection="False"
                EnableBufferData="False" EnableEdit="False" Height="300px"
                SelectMultiple="False" >

The solution builds right with VS2008 but when I try to run it in Mono:

Cannot cast from source type to destination type.

Description: HTTP 500. Error processing request.

Stack Trace:
System.InvalidCastException: Cannot cast from source type to destination
  at System.Web.UI.ScriptManager.GetCurrent (System.Web.UI.Page page)
[0x00011] in
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x000ca] in

Version information: Mono Runtime Version: 2.6.1 (tarball); ASP.NET Version:

Here is the full site (really simple):
http://n4.nabble.com/file/n1557102/extatica.zip extatica.zip 

Thanks for your help (and sorry for my english)
View this message in context: http://n4.nabble.com/System-InvalidCastException-with-ScriptManager-tp1557102p1557102.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.

More information about the Mono-aspnet-list mailing list