[Mono-bugs] [Bug 78533][Cri] New - System.InvalidCastException: Cannot cast from source type to destination type

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon May 29 12:29:38 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by torsten.zachert at teserco.de.

http://bugzilla.ximian.com/show_bug.cgi?id=78533

--- shadow/78533	2006-05-29 12:29:38.000000000 -0400
+++ shadow/78533.tmp.19383	2006-05-29 12:29:38.000000000 -0400
@@ -0,0 +1,115 @@
+Bug#: 78533
+Product: Mono: Runtime
+Version: 1.1
+OS: other
+OS Details: OpenSuse 10.0
+Status: NEW   
+Resolution: 
+Severity: 040 One week
+Priority: Critical
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: torsten.zachert at teserco.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.InvalidCastException: Cannot cast from source type to destination type
+
+The following problem is reproducable on Linux. It works on MS.NET.
+
+
+Steps to reproduce the problem:
+1. First page: Default.aspx:
+<%@ Page Language="C#" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<script runat="server">
+    protected void Page_Load(object sender, EventArgs e)
+    {
+        if (Request.Params["__NAVIEVENTARGUMENT"] != null)
+        {
+            switch (Request.Params["__NAVIEVENTARGUMENT"].ToString().Trim())
+            {
+                case "UC1":
+                   
+this.mainContentPlaceHolder.Controls.Add(Page.LoadControl("./uc_test1.ascx"));
+                    break;
+                case "UC2":
+                   
+this.mainContentPlaceHolder.Controls.Add(Page.LoadControl("./uc_test2.ascx"));
+                    break;
+            }      
+        }      
+    }
+</script>
+
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head runat="server">
+    <title>Unbenannte Seite</title>
+</head>
+<body>
+    <form id="DefaultForm" runat="server">
+        <div>
+        <input type="hidden" name="__NAVIEVENTTARGET"
+id="__NAVIEVENTTARGET" value="" />     
+        <input type="hidden" name="__NAVIEVENTARGUMENT"
+id="__NAVIEVENTARGUMENT" value="" />
+    </div>
+    
+    <script type="text/javascript">
+        <!--
+        var theForm = document.forms['DefaultForm'];
+        if (!theForm) {
+            theForm = document.DefaultForm;
+        }
+        function __doPostBack(eventTarget, eventArgument) {
+            if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
+                theForm.__NAVIEVENTTARGET.value = eventTarget;
+                theForm.__NAVIEVENTARGUMENT.value = eventArgument;
+                theForm.submit();
+            }
+        }
+        // -->
+    </script>
+    <div>
+        <asp:PlaceHolder ID="mainContentPlaceHolder"
+runat="server"></asp:PlaceHolder>
+    </div>  
+      
+    <div>
+        <a href="javascript:__doPostBack('NAVI','UC1')"
+target="_self">uc_test1</a><br />
+        <a href="javascript:__doPostBack('NAVI','UC2')"
+target="_self">uc_test2</a>
+    </div>
+    
+
+    </form>
+</body>
+</html>
+
+2. First User Control: uc_test1.ascx
+<%@ Control Language="C#" ClassName="uc_test1"  %>
+<div>
+<asp:DropDownList ID="dropDownListCategorySearch"
+runat="server"></asp:DropDownList>
+</div>
+
+3. Second User Control: uc_test2.ascx
+<%@ Control Language="C#" ClassName="uc_test2" %>
+<div>
+<asp:TextBox ID="textBoxTitle" runat="server"></asp:TextBox>
+</div>
+
+Actual Results:
+If I change between these 2 Links, then it causes
+System.InvalidCastException: Cannot cast from source type to destination type.
+
+Expected Results:
+no error
+
+How often does this happen? 
+every time


More information about the mono-bugs mailing list