[英]Render Self-Closing Tag in ASP.NET custom control derived from Control
[英]How to extract information from self-closing xml elements in vb.net in asp.net?
例如,
<Image><URL scope="public" type="string" value"image URL"/></Image>
我想從此元素中提取圖像URL(URL的值)並顯示圖像。 我怎樣才能做到這一點?
您可以使用XDocument
( LINQ-to-XML ):
Dim url As String = XDocument.Load(new StringReader("<Image><URL scope=\"public\" type=\"string\" value=\"image URL\"/></Image>")).Descendants("URL").Attribute("value").Value
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.