제목에서 알 수 있듯이 asp.net의 장바구니를 나타내는 간단한 5column/5rows GridView가 있습니다. 선택한 행과 버튼 클릭시 모든 행을 삭제하려면 자바 스크립트를 사용해야합니다. 어떻게 그럴 수 있니? 항목이 제거되면 총 가격도 변경되어야합니다. 미리 Thx.자바 스크립트로 gridview에서 선택된 행/모든 행을 삭제합니다.
이 샘플 영문 코드 :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Kosarica.aspx.cs" Inherits="Spletna_kosarica_2.Kosarica" EnableSessionState="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>Kosarica:</h2>
<p>
<asp:GridView ID="GridView1" runat="server" Width="440px"
AutoGenerateSelectButton="True">
</asp:GridView>
</p></div>
<asp:Button ID="Button2" runat="server" onclick="Button2_Click"
Text="Dodaj artikel" Width="143px" />
<asp:Button ID="Button3" runat="server" Text="Remove" />
<asp:Label ID="Label1" runat="server" Text="Total price:"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</form>
</body>
</html>
asp.net http://www.asp.net/web-forms/videos/how-do-i/how-do-i-create-and-call-a-simple-web-service-in-aspnet에서 웹 서비스에 대한 비디오 자습서이다. –