I need your help. I am new to xml and need to get its attribute.
I have a mailbox(XmlNode) that is represented by the following InnerXml
<Mailbox Id="1" Name="[email protected]" />
I need to access the Id attribute using this piece of code
mailbox.Attribute["Id"].Value
but it throws null reference exception. I haven't found any solution, as I can't make any changes to the
....mailbox.Attribute["Id"].Value .....part of code
can anyone help me?
mailbox?Id-- the font was misleading me; it looks like capital I was used.. In that case, I think Wiktor's question is on target: whatever mailbox represents, it isn't the<Mailbox>element shown above. (At least it probably isn't a namespace issue; attributes don't take default namepaces.)