How to cast json object into a string
<p>Here i'm having json string and i wanted to get one perticular key and value from this json string.So I have used javascript serializer for that.
Below is the code which i have used in C#.Net.</p>

<pre><code>string strProfile = fbApi.GetForStr("/statefarm/feed/");
var jss = new JavaScriptSerializer();
var dictionary = (IDictionary&lt;string, object&gt;)jss.DeserializeObject(strProfile);  
object keyvalue = (object)dictionary["paging"]; 
string data = keyvalue.ToString();
</code></pre>

<p>When i do this  I'm not able to fetch the keyvale pair from the jsonstring. If i write</p>

<pre><code>string keyvalue = (string)dictionary["paging"]; 
</code></pre>

<p>instead of </p>

<pre><code>object keyvalue = (object)dictionary["paging"]; 
string data = keyvalue.ToString();
</code></pre>

<p>getting on exception called </p>

<blockquote>
  <p>object of type 'system.object ' to type 'system.string '</p>
</blockquote>

<p>What to do for this and how it can bne written. </p>
