Hi,
I want to move my html code:
to c# code.
So I wrote in Page_Load:
but I get an error
"The DataSourceID of 'RadMenu1' must be the ID of a control of type IDataSource. A control with ID 'XmlDataSourceForMenuID' could not be found. ".
How can I fix this bug?
I want to move my html code:
| <telerik:RadMenu ID="RadMenu1" runat="server" DataNavigateUrlField="Url" |
| DataSourceID="XmlDataSourceForMenu" DataTextField="Text" DataValueField="Value"> |
| </telerik:RadMenu> |
| <asp:XmlDataSource ID="XmlDataSourceForMenu" runat="server" |
| DataFile="~/MenuConfig.xml" XPath="/Items/Item"></asp:XmlDataSource> |
So I wrote in Page_Load:
| XmlDataSource XmlDataSourceForMenu = new XmlDataSource(); |
| XmlDataSourceForMenu.ID = "XmlDataSourceForMenuID"; |
| XmlDataSourceForMenu.DataFile = "~/MenuConfig.xml"; |
| XmlDataSourceForMenu.XPath = "/Items/Item"; |
| RadMenu1.DataSourceID = XmlDataSourceForMenu.ID; |
| RadMenu1.DataNavigateUrlField = "Url"; |
| RadMenu1.DataTextField = "Text"; |
| RadMenu1.DataValueField = "Value"; |
"The DataSourceID of 'RadMenu1' must be the ID of a control of type IDataSource. A control with ID 'XmlDataSourceForMenuID' could not be found. ".
How can I fix this bug?