title: Populate textboxes with XmlNode.Attributes
body: <p>I have Data.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;data&gt;
  &lt;album&gt;
      &lt;slide title="Autum Leaves"
          description="Leaves from the fall of 1986"
          source="images/Autumn Leaves.jpg"
          thumbnail="images/Autumn Leaves_thumb.jpg" /&gt;
      &lt;slide title="Creek"
          description="Creek in Alaska"
          source="images/Creek.jpg"
          thumbnail="images/Creek_thumb.jpg" /&gt;
  &lt;/album&gt;
  &lt;/data&gt;
  </code></pre>
  
  <p>I'd like to be able to edit the attributes of each Slide node via GridView (that has a "Select" column added.) And so far I have:</p>
  
  <pre><code>protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
  {
      int selectedIndex = GridView1.SelectedIndex;
      LoadXmlData(selectedIndex);
  }
  
  private void LoadXmlData(int selectedIndex)
  {
      XmlDocument xmldoc = new XmlDocument();
      xmldoc.Load(MapPath(@"..\photo_gallery\Data.xml"));
      XmlNodeList nodelist = xmldoc.DocumentElement.ChildNodes;
      XmlNode xmlnode = nodelist.Item(selectedIndex);
      titleTextBox.Text = xmlnode.Attributes["title"].InnerText;
      descriptionTextBox.Text = xmlnode.Attributes["description"].InnerText;
      sourceTextBox.Text = xmlnode.Attributes["source"].InnerText;
      thumbTextBox.Text = xmlnode.Attributes["thumbnail"].InnerText;
  }
  </code></pre>
  
  <p>The code for LoadXmlData is just a guess on my part - I'm new to working with xml in this way. I'd like have the user to slected the row from the gridview, then populate a set of text boxes with each slide attributed for updating back to the Data.xml file.</p>
  
  <blockquote>
    <p>The error I'm getting is Object reference not set to an instance of an object" at the line: titleTextBox.Text = xmlnode.Attributes["@title"].InnerText;</p>
  </blockquote>
  
  <p>so I'm not reaching the attribute "title" of the slide node. Thanks for any ideas you may have.</p>