title: Using javascript in Asp.NET
body: <p>I have a problem that I want to call the javascript code, when selection of gridview is changing. But, I can not start my javascript. How can I do that? </p>
  
  <p>//Html side</p>
  
  <pre><code>&lt;input ID="addressinput" type="text"  runat="server" style="display:none;"/&gt;
  
  &lt;asp:Button ID="Button1" runat="server" Text="Button" style="display:none;" OnClientClick="return myfunction();" onclick="Button1_Click"  /&gt;
  </code></pre>
  
  <p>//Javascript</p>
  
  <pre><code>function myfunction() {
      FindLocaiton();
  }
  </code></pre>
  
  <p>//C#</p>
  
  <pre><code>protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
  {
      addressinput.Value = GridView1.SelectedRow.Cells[1].Text;
       Button1.Click += new EventHandler(Button1_Click);
  }
  
  protected void Button1_Click(object sender, EventArgs e)
  {
  
  }
  </code></pre>