getting current element id node for select
i have an xml file in my web project so i need edit some of them when user wants and i write codes like this;
public
void EditAnnouncement(int intAnnID,string strAnnTitle,string strAnnBody){
XmlDocument annDoc =newXmlDocument();annDoc.Load(
HttpContext.Current.Server.MapPath("~/App_Data/Announcement.xml"));string xpathExpression =string.Format("//annPanel/ann[annID={0}]", intAnnID);XmlNode ann = annDoc.SelectSingleNode(xpathExpression);if (ann ==null){
thrownewException(string.Format("Element 'ann' with id ='{0}' not found"), intAnnID);}
XmlElement annTitle = (XmlElement)ann.SelectSingleNode("annTitle");annTitle.InnerText = strAnnTitle;
XmlElement annBody = (XmlElement)ann.SelectSingleNode("annBody");annTitle.InnerText = strAnnBody;
annDoc.Save(
HttpContext.Current.Server.MapPath("~/App_Data/Announcement.xml"));}
but i need intannID variable from somewhere how can i get this for current node which user wants to edit?
i think that i must write a function that gets the current announcement id node innertext which user want to edit ; and set it to any variable likeabc=getID(); and after call editAnnouncement func. (EditAnnoncement(abc,bb,cc) ) but i couldnt write getID func; how can i select innertext of current announcement id ?
this is my xml;
<
annPanel><
ann><
annID></annID><
annTitle></annTitle><
annBody></annBody><
annPubDate><
annDate></annDate><
annTime></annTime></
annPubDate></
ann></annPanel>

