title: how to download json object in file asp.net
body: <p>i have class</p>
  <pre><code>    class abc{
         [JsonPropertyName(&quot;firstName&quot;)]
         public string FirstName{get; set;}
  
         [JsonPropertyName(&quot;lastName&quot;)]
         public string LastName{get; set;} }
  </code></pre>
  <p>i am assigning some values in it one method.</p>
  <pre><code>     public void DownloadJson(){
       abc abcModel= new abc(){ FirstName=&quot;Tom&quot;, LastName=&quot;Torres&quot;};
  
       var test = JsonConvert.SerializeObject(abcModel);
       }
  </code></pre>
  <p>i want to save(download) this test object in json file on my browserwithout directing in new window just simply download it in same method DownloadJson() and in current window.</p>