title: Refresh Web Page after Converting base64 to image
body: <p>I have a base64 data and I want to convert it to Image in Asp.net. I use this Code</p>
  <pre><code>byte[] data = Convert.FromBase64String(imageData);
  var path = Server.MapPath(&quot;~/ImageFolder/&quot;) +  &quot;AAA.jpeg&quot;;
  System.IO.File.WriteAllBytes(path, data); //(*)
  </code></pre>
  <p>when the code reach at line (*), Page Refresh, but I don't want to refresh.
  what is solution for converting base64 to image and save in folder without page refreshing?</p>
  <p>if i use <code>MemoryStream</code>, the Problem exist and page will refresh.</p>
  <p><strong>UPDATE</strong></p>
  <p>I have this codes on client sides</p>
  <pre><code>function ajaxCall(url, data, callBackFunction) {
      $.ajax({
          url: url,
          type: &quot;POST&quot;,
          contentType: &quot;application/x-www-form-urlencoded; charset=UTF-8&quot;,
          data: data,
          success: function (response) {
              callBackFunction(response);
          },
          error: function (xhr, status, error) {
              alert(error);
          },
      });
  }
  </code></pre>
  <p>And</p>
  <pre><code>    ajaxCall('/Default/Save/', {
   final: _final, // Some boolean flag
          imageData: imgData, // Image Base64
      }, function (response) {
          $('#resultDiv').html(response)
      });
  </code></pre>
  <p>And in Server</p>
  <pre><code>[HttpPost]
      public ActionResult Save(bool final,string imageData)
      {
          var thumbHash = &quot;&quot;;
          if (imageData.Length &gt; 0)
          {
              try
              {
                  imageData = imageData.Replace(&quot;data:image/jpeg;base64,&quot;, String.Empty);
                  byte[] data = Convert.FromBase64String(imageData);
                  thumbHash = &quot;123456789ABC&quot;;
     var path = Server.MapPath(&quot;~/ImageFolder/&quot;) +  &quot;AAA.jpeg&quot;;
                
                  System.IO.File.WriteAllBytes(path, data); //(*)
  
              }
              catch (Exception ex)
              {
                  thumbHash = &quot;&quot;;
              }
          }
  
        
          if (final)
              return RedirectToAction(&quot;AddOne&quot;, &quot;Cart&quot;, new { id = 12 });
  
        
          return Json( &quot;Ahm&quot; );
      }
  </code></pre>