XPathNavigator GetAttribute String

D

DN

This works:

nav.GetAttribute("@ATTRIBUTE","");

This doesn't:

string strTemp = "@ATTRIBUTE";
nav.GetAttribute(strTemp,"");

Anybody know a way around this?
 
T

Teemu Keiski

Those two you posted are equivalent. What you probably meant is that another
is with @ (at) and another isnt? Anyway, GetAttribute takes the local name
of the attribute and @ is not needed in the name. e.g
nav.GetAttribute("attribute_name",""). Does the attribute belong to some
namespace?

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

This works:

nav.GetAttribute("@ATTRIBUTE","");

This doesn't:

string strTemp = "@ATTRIBUTE";
nav.GetAttribute(strTemp,"");

Anybody know a way around this?
 
D

DN

Thanks Teemu... (as I shake my head in shame)....I think it's time for me to
get some sleep.
DN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top