Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Specified cast is not valid, error in upgrade 1.2
Message
De
06/09/2004 21:47:34
 
 
À
06/09/2004 21:13:14
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00939722
Message ID:
00939827
Vues:
12
Neil,

>Thank you Bonnie. You are correct. Gordon's reference did not help me out.

Didn't think it would. <g> But I'm glad you figured it out on your own.

>Bonnie. I know you are questioning my choice mmDropDownList as a control for a simply list.

Actually, no I wasn't ... I don't really do much WebForm stuff, so I couldn't say one way or the other what's a good way to do this. <g>

~~Bonnie


>
>I found the problem by systematically pealing off controls from the web form. This is what I found.
>
>I had an instance of mmDropDownList on the form that did not have BindingValueSource or BindingValueSourceMember assigned. I am using the DropDown as a simple list. That is why I did not need to assign values to BindingValueSource or BindingValueSourceMember. In versions of mm.net prior to 1.2 I was able use the mmDropDownList without assigning BindingValueSource or BindingValueSourceMember and everything worked well. The fix in version 1.2 is this. If you are using mmDropDownList as a simple list and don't need to assign values to BindingValueSource or BindingValueSourceMember you need to do the following. You *will* have to assign BindingValueSource to the same value as you assigned BindingSource. I guess what we need is a more gentle way of being informed that mmDropDownList is missing a value for BindingValueSource without causing a runtime crash. Or better yet. Maybe a property for mmDropDownList which would indicate that we are using the control as a simple list and not
>to bug out if it doesn't get a value for BindingValueSource or BindingValueSourceMember.
>
>Bonnie. I know you are questioning my choice mmDropDownList as a control for a simply list. It is actually a very cool way to data drive the populating of a small DropDownList via a business object that was previously created for other purposes.
>
>Hope this helps others upgrading to 1.2 that are using mmDropDownList in this manner.
>
>Regards,
>Neil
>
>
>
>>Gordon,
>>
>>>>Please refer to Message ID #928561 for a complete set of instructions for correcting issues moving to 1.2.
>>
>>Either I missed it or you posted the wrong Message # ... that message says nothing about the problem that Neil says he has (a "specified cast invalid" error on a Page_Load). Did I miss something?
>>
>>~~Bonnie
>>
>>
>>>Hello,
>>>
>>>Please refer to Message ID #928561 for a complete set of instructions for correcting issues moving to 1.2.
>>>
>>>Thank you,
>>>
>>>>Hi,
>>>>
>>>>I just upgraded to mm.net 1.2. I have a web form that crashes after it's Page_Load. The error is:
>>>>
>>>>
>>>>Specified cast is not valid.
>>>>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
>>>>
>>>>Exception Details: System.InvalidCastException: Specified cast is not valid.
>>>>
>>>>Source Error:
>>>>
>>>>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
>>>>
>>>>Stack Trace:
>>>>
>>>>
>>>>[InvalidCastException: Specified cast is not valid.]
>>>> OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.BindControl(ImmWebBinding control, String bindingSource, String bindingMember)
>>>> OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.OnBubbleEvent(Object source, EventArgs e)
>>>> System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
>>>> OakLeaf.MM.Main.Web.UI.WebControls.mmDropDownList.OnLoad(EventArgs e)
>>>> System.Web.UI.Control.LoadRecursive()
>>>> System.Web.UI.Control.LoadRecursive()
>>>> System.Web.UI.Control.LoadRecursive()
>>>> System.Web.UI.Page.ProcessRequestMain()
>>>>
>>>>
>>>>
>>>>
>>>>--------------------------------------------------------------------------------
>>>>Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
>>>>
>>>>
>>>>If I set a break point before the end of Page_Load I can step to the final curly bracket. If I step beyond the end bracket I get a dialog which points me to the disassembly trace:
>>>>
>>>>000000 push ebp
>>>>00000001 mov ebp,esp
>>>>00000003 sub esp,0Ch
>>>>00000006 push edi
>>>>00000007 push esi
>>>>00000008 push ebx
>>>>00000009 mov dword ptr [ebp-8],edx
>>>>0000000c mov esi,ecx
>>>>0000000e xor ebx,ebx
>>>>00000010 cmp dword ptr [esi+18h],0
>>>>00000014 je 00000053
>>>>00000016 mov edi,dword ptr [esi+18h]
>>>>00000019 mov ecx,709h
>>>>0000001e call F98653C8
>>>>00000023 mov eax,dword ptr [eax+8]
>>>>00000026 mov edx,dword ptr [eax]
>>>>00000028 mov ecx,edi
>>>>0000002a cmp dword ptr [ecx],ecx
>>>>0000002c call 00B658B8
>>>>00000031 mov edi,eax
>>>>00000033 mov edx,edi
>>>>00000035 mov ecx,79BA780Ch
>>>>0000003a call 71F88004
>>>>0000003f mov ebx,eax
>>>>00000041 test ebx,ebx
>>>>00000043 je 00000053
>>>>00000045 push dword ptr [ebp-8]
>>>>00000048 mov edx,esi
>>>>0000004a mov ecx,ebx
>>>>0000004c cmp dword ptr [ecx],ecx
>>>>0000004e call 7294A93B
>>>>00000053 nop
>>>>00000054 pop ebx
>>>>00000055 pop esi
>>>>00000056 pop edi
>>>>00000057 mov esp,ebp
>>>>00000059 pop ebp
>>>>0000005a ret
>>>>
>>>>
>>>>
>>>>Any thoughts?
>>>>Neil
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform