Last post Dec 22, 2006 03:12 PM by davidebb
Dec 19, 2006 05:02 PM|scotts|LINK
I usually define domain objects in the app_code folder or in separate referenced dll’s when building asp.net web apps (vb, c#). Then, when using one of the data controls (like the GridView data control), I’m able to bind to a “ObjectDataSource” and have
the source of this control be one of the domain objects defined in either the app_code or a referenced dll. The ObjectDataSource doesn’t appear to currently work when used on an IronPython page.
For example, regardless if I create python domain classes in my app_script folder, or other non python referenced external dll’s, the object data source does not recognize any of these classes as valid data sources. If I add another aspx page (of type vb
or c#, not IronPython) to the same web project and then add a Gridview and ObjectDatasource to this non IronPython page, the ObjectDatasource wizard is able to find all the non IronPython classes referenced by the project and they are available as the source
for an ObjectDatasource control.
Will we eventually be able to define IronPython classes in our app_script folder, and then use this as an ObjectDataSource on an IronPython aspx?
Dec 20, 2006 08:35 PM|davidebb|LINK
The problem is that IronPython classes are not real types in the framework sense. i.e. you can't get a System.Type for them and reflect on the members, which is what ObjectDataSource needs to do.
I think the solution may be to come up with a new type of data source which is more friendly to script objects. We have that on our list of things to investigate.
Dec 21, 2006 11:10 AM|scotts|LINK
Thanks for the feedback David.
I sort of expected a problem reflecting upon the Python dynamic script classes, but was surprised that an ObjectDataSource placed on an IP aspx page was not able to reflect
upon externally referenced dll’s (i.e. vb.net and c# dlls’).
Dec 21, 2006 04:49 PM|davidebb|LINK
I'm sorry, I didn't read your initial mail carefully enough. I also don't understand why it would affect the case where you reference non-Python types. To make sure I understand:
Dec 22, 2006 10:26 AM|scotts|LINK
Dave, here are some bullet points:
Dec 22, 2006 03:12 PM|davidebb|LINK
Thanks Scott, I am now able to repro the issue. Note that this is purely a designer issue, and not a runtime issue. So even though the wizard is broken, if you get the correct ObjectDataSource in your page (e.g. by copying from C# page, ...), it should
run just fine.
I will report the issue to the designer team.