Delete selected/all rows from gridview with javascript <p>As the title says, I have a simple 5column/5rows GridView which represents a shopping cart in asp.net. I need to use javascript to delete selected row and all the rows on button click. How could that be done? Total price should change too when an item is removed. Thx in advance.</p> <p>This is sample aspx code:</p> <pre><code> &lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Kosarica.aspx.cs" Inherits="Spletna_kosarica_2.Kosarica" EnableSessionState="True" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;h2&gt;Kosarica:&lt;/h2&gt; &lt;p&gt; &lt;asp:GridView ID="GridView1" runat="server" Width="440px" AutoGenerateSelectButton="True"&gt; &lt;/asp:GridView&gt; &lt;/p&gt;&lt;/div&gt; &amp;nbsp;&lt;asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Dodaj artikel" Width="143px" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;asp:Button ID="Button3" runat="server" Text="Remove" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;asp:Label ID="Label1" runat="server" Text="Total price:"&gt;&lt;/asp:Label&gt; &amp;nbsp;&lt;asp:Label ID="Label2" runat="server" Text="Label"&gt;&lt;/asp:Label&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>