How to Include CData using LINQ to XML?

后端 未结 1 1663
北荒
北荒 2020-12-19 01:05

I want to record to a XML with below those codes in ASP.Net.However,I want to add in the fifth element. when I making it as shown below,

1条回答
  •  死守一世寂寞
    2020-12-19 01:47

    Try this:

    new XElement("description",
        new XCData("<>" + TextBox5.Text)),
    

    in place of your current

    new XElement("description", "<>" + TextBox5.Text),
    

    line.

    0 讨论(0)
提交回复
热议问题