Webmatrix XMLEditGrid
Jeg er ved at køre tutorialen for webmatrix og er nået hertil:http://www.asp.net/webmatrix/tour/section1/addcustomcontrol.aspx
Jeg har dermed 2 filer:
myFirstCustomPage.aspx
-------------------------------------------------
<html>
<head>
</head>
<body>
<form runat="server">
<xedit:XmlEditGrid id="XmlEditGrid1" runat="server" ForeColor="Black" GridLines="Vertical" CellPadding="3" BackColor="White" BorderColor="#999999" BorderWidth="1px" BorderStyle="Solid" XmlFile="myFirstXMLFile.xml">
<FooterStyle backcolor="#CCCCCC"></FooterStyle>
<SelectedItemStyle font-bold="True" forecolor="White" backcolor="#000099"></SelectedItemStyle>
<PagerStyle horizontalalign="Center" forecolor="Black" backcolor="#999999"></PagerStyle>
<HeaderStyle font-bold="True" forecolor="White" backcolor="Black"></HeaderStyle>
<AlternatingItemStyle backcolor="#CCCCCC"></AlternatingItemStyle>
</xedit:XmlEditGrid>
<!-- Insert content here -->
</form>
</body>
</html>
og....
myFirstAMLFile.xml
--------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<Orders>
<Order>
<ID>1</ID>
<OrderDate>4/23/2002</OrderDate>
<CustomerName>Bob Smith</CustomerName>
</Order>
<Order>
<ID>2</ID>
<OrderDate>5/12/2002</OrderDate>
<CustomerName>Sally Jones</CustomerName>
</Order>
</Orders>
Det ser jo såre simpelt ud, men alligevel kommer der kun en fejlmeddelelse:
-----------------------------------------------
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.]
Swarren.XmlEditGrid.XmlEditGrid.GetClientScriptPath() +42
Swarren.XmlEditGrid.XmlEditGrid.OnInit(EventArgs e) +48
System.Web.UI.Control.InitRecursive(Control namingContainer) +240
System.Web.UI.Control.InitRecursive(Control namingContainer) +178
System.Web.UI.Control.InitRecursive(Control namingContainer) +178
System.Web.UI.Page.ProcessRequestMain
Er der nogen, der har et forslag ?
