title: Reloading iframe in ASP.NET site from C# code
body: <p>Trying to reload an iframe after C# has modified its attributes. Here's the page:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function reloadFrame(Map) {
          document.getElementById(Map).contentDocument.location.reload(true);
      }
  &lt;/script&gt;
  
  &lt;asp:TextBox ID="TextBox1" placeholder="Zip code" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:Button ID="Button1" runat="server" Text="Find locations" onclick="Button1_Click" /&gt;
  &lt;iframe id="Map" runat="server"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>And when the button is clicked it runs this:</p>
  
  <pre><code>var zipCode = TextBox1.Text;
  Map.Attributes.Add("src", "https://www.google.com/maps/preview#!q=gnc+near%3A+" + zipCode);        
  browser.Document.InvokeScript("reloadFrame", new[] { "Map" });
  </code></pre>
  
  <p>However the line to reload the iframe doesn't work. Any ideas?</p>