Avoid Page refresh on button click?
<p>I have this .net page where I have a media player control and a button. The button functionality is to call a stored procedure. I need the page NOT to reload and stop the video when the user clicks the button.</p>

<p>Is there a way to do this?</p>

<p>Here is the code</p>

<p>watching.aspx</p>

<pre><code>&lt;div id="video" runat="server"&gt;
    &lt;div id="myElement"&gt;
        Loading...
    &lt;/div&gt;
&lt;/div&gt;
&lt;asp:Button ID="btnWatchlist" runat="server" Text="add to watchlist" onclick="btnWatchlist_Click" /&gt;
</code></pre>

<p>watching.aspx.cs</p>

<pre><code>public partial class Watching : System.Web.UI.Page
{
    private int movieId = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
         movieId = Int32.Parse(Request.QueryString["id"]);
         Movie movie = MovieAccess.GetMovieDetails(movieId);
         startVideo(movie);      
    }
    private void startVideo(Movie movie)
    {
        string moviePath= "data/videos/"+movie.srcPath;
        String script = "&lt;script type='text/javascript'&gt;jwplayer('myElement').setup({file: '" + moviePath + "',image: '43.jpg', \"width\": 800,\"height\": 450,});&lt;/script&gt;";
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "video", script, false);
    }
    protected void btnWatchlist_Click(object sender, EventArgs e)
    {
        MovieAccess.AddWatchlistMovie(movieId, User.Identity.Name);
    }
}
</code></pre>
