title: Using JSON.decode razor webhelper with a number node in C#?
body: <p>I'm using the JSON razor web helper (<a href="http://msdn.microsoft.com/en-us/library/gg538324%28v=vs.111%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/gg538324%28v=vs.111%29.aspx</a>) to decode a JSON string I have with multiple nested nodes.</p>
  
  <p>I used the JSON.Decode method fine on another project, but on this project my JSON source string has nested nodes that start with a number and I'm having issues.</p>
  
  <p>My JSON string looks something like </p>
  
  <pre><code>myJSONString="
  {
  Foo1: ‘data’,
  ‘Foo2:’  {
      ‘123':{
          ‘goodStuff’:{ [
                      {
                        boo1: ‘Data1’,
                        boo2: ‘Data2’
                      }
                      ] }
            }
           }
  }   "
  </code></pre>
  
  <p>Normally I would do:</p>
  
  <pre><code>var decodedJsonString = Json.Decode(myJSONString) &lt;br&gt; 
  </code></pre>
  
  <p>and access data like: <br>
  <br></p>
  
  <pre><code>foreach(var p in decodedJsonString.Foo2.123.goodStuff)
  { 
     p.boo1; &lt;br&gt;
     p.boo2; &lt;br&gt;
  } 
  </code></pre>
  
  <p><br>
  Normally this worked fine for me, but I get an error that it doesn't like the <em>.123.</em> part, since the node starts with a number, rather then a letter. The inline error is "Identifier expected". If I run the webpage the server error is that it: " ) Expected ".</p>
  
  <p>Any suggestions? Thank you!</p>
  
  <p>I can get around this by using a lot of foreach loops like: <br> <br></p>
  
  <pre><code>foreach( var p in decodedJsonString.Foo2)
  { 
     var k = p.Value;
     if(p.Key.Equals("123"))
    {
      foreach(var j in k)
      {
       //etc
      }
    }
  }
  </code></pre>
  
  <p>Just not sure how to make this a decoded JSON object that I can reference it again like decodedJsonString.Foo2.123.goodStuff</p>
  
  <p>Appreciate any assistance. Sorry if I'm missing something obvious! Thank you again.</p>