Hi,
I have one xml file where i have defined URL as one attribute in all xml node. Based on some condition i need to set this URL value. So i cannot assign values to static xml. To achieve this functionality in code behind file I have implemented as below. But it is not fetching the newly set URL value.
Can anybody help me in re bind the xml data source to radmenu item?
'Get the list of name nodes
xmlnodelst = xmlFinalDoc.SelectNodes("Items/Item/Item")
For Each xmlParentNode In xmlnodelst
For Each xmlnode In xmlParentNode.ChildNodes
If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 42 Or CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then
If CBool(objBOApplication.Group.UsePaymentBatchDetails) Then
If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then
xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PaymentBatchCreate.aspx?payMode=O"
Else
xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PaymentBatchCreate.aspx?payMode=E"
End If
Else
If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then
xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PayBatch.aspx?payMode=O"
Else
xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PayBatch.aspx?payMode=E"
End If
End If
End If
Next
Next
xmlDataSrc.Dispose()
xmlDataSrc.Data = xmlFinalDoc.OuterXml
xmlDataSrc.XPath = PresentationConstants.XPATH
xmlDataSrc.DataBind()
mnuKAM.Items.Clear()
mnuKAM.DataSource = xmlDataSrc
mnuKAM.DataNavigateUrlField = PresentationConstants.URL
mnuKAM.DataTextField = PresentationConstants.TEXT
mnuKAM.DataValueField = PresentationConstants.Value
radMnuBindg.ImageUrlField = PresentationConstants.IMAGE
radMnuBindg.NavigateUrlField = PresentationConstants.URL
radMnuBindg.TextField = PresentationConstants.TEXT
radMnuBindg.ValueField = PresentationConstants.Value
mnuKAM.DataBindings.Add(radMnuBindg)
mnuKAM.DataBind()
I have one xml file where i have defined URL as one attribute in all xml node. Based on some condition i need to set this URL value. So i cannot assign values to static xml. To achieve this functionality in code behind file I have implemented as below. But it is not fetching the newly set URL value.
Can anybody help me in re bind the xml data source to radmenu item?
'Get the list of name nodes
xmlnodelst = xmlFinalDoc.SelectNodes("Items/Item/Item")
For Each xmlParentNode In xmlnodelst
For Each xmlnode In xmlParentNode.ChildNodes
If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 42 Or CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then
If CBool(objBOApplication.Group.UsePaymentBatchDetails) Then
If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then
xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PaymentBatchCreate.aspx?payMode=O"
Else
xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PaymentBatchCreate.aspx?payMode=E"
End If
Else
If CDbl(xmlnode.Attributes.GetNamedItem("Value").Value) = 41 Then
xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PayBatch.aspx?payMode=O"
Else
xmlnode.Attributes.GetNamedItem("Url").Value = "../Pages/PayBatch.aspx?payMode=E"
End If
End If
End If
Next
Next
xmlDataSrc.Dispose()
xmlDataSrc.Data = xmlFinalDoc.OuterXml
xmlDataSrc.XPath = PresentationConstants.XPATH
xmlDataSrc.DataBind()
mnuKAM.Items.Clear()
mnuKAM.DataSource = xmlDataSrc
mnuKAM.DataNavigateUrlField = PresentationConstants.URL
mnuKAM.DataTextField = PresentationConstants.TEXT
mnuKAM.DataValueField = PresentationConstants.Value
radMnuBindg.ImageUrlField = PresentationConstants.IMAGE
radMnuBindg.NavigateUrlField = PresentationConstants.URL
radMnuBindg.TextField = PresentationConstants.TEXT
radMnuBindg.ValueField = PresentationConstants.Value
mnuKAM.DataBindings.Add(radMnuBindg)
mnuKAM.DataBind()