Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1465
Refreshing Menu from XML source
posted

Hello.

I'm using 8.1, the UltraWebMenu control, and binding to abn XML Datasource.

The acutal menu items are stored in a database, which are returned as a DataSet, converted to XML and transformed to another XML doc and bound to the XmlDatasource object. Everything works fine.

The problem is refreshing the menu. Perodically the XmlDatasource is repopulated (refreshed) but the UltraWebMenu doesn't reflect the updated XML doc. Here's the code from the page that is hosting the UltraWebMenu (both the XmlDatasource and UltraWebMenu controls have their EnableViewState property set to False):

Partial Public Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   Me.XmlDataSource1.Data = Application("MenuXML").ToString()  ' This is the new XML doc retrieved from the database
   Me.XmlDataSource1.DataFile = ""
   Me.XmlDataSource1.XPath = "/root/item[@MenuName='MNUMASTERTOP']"
   Me.XmlDataSource1.DataBind()
End Sub

Private Sub UltraWebMenu1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles UltraWebMenu1.PreRender
   Me.UltraWebMenu1.Items.Clear()
   Me.UltraWebMenu1.DataSourceID = ""
   Me.UltraWebMenu1.DataSource = Me.XmlDataSource1
   Me.UltraWebMenu1.DataBind()
End Sub

End Class

Any ideas?

Thanks in advance,

Mike