<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="addtocourse.aspx.cs" Inherits="Math.math.addtocourse" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../javascript/jquery-1.12.4.min.js"></script>
    <script src="../javascript/layer/layer.js"></script>
        <link href="../javascript/layui/css/layui.css" rel="stylesheet" /> 
        <script src="../javascript/layui/layui.js"></script> 

    <style>
        a{ color:#336699}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div  >

        <asp:GridView runat="server" AllowPaging="true" CssClass="layui-table"
             AutoGenerateColumns="false"   
             PageSize="10" ID="gv_list" OnPageIndexChanging="gv_list_PageIndexChanging">
            <Columns>
                <asp:BoundField HeaderText="课程名称" HeaderStyle-Width="400" DataField="coursename" />

                <asp:TemplateField>
                    <HeaderStyle Width="100" />
                    <HeaderTemplate>操作</HeaderTemplate>

                    <ItemTemplate>
                        <a href="##" onclick="_add(this,<%#Eval("id") %>,<%=pid %> );">添加到此课程</a>

                     
                    </ItemTemplate>
                </asp:TemplateField>

            </Columns>



        </asp:GridView>
    


         <script>

        function _add(obj,cid,pid)
        {
             

            $.get("../api/del.aspx?t=addtocourse&cid="+cid+"&pid="+pid);
            
            $(obj).hide();
            layer.msg("添加成功");
            
        }



    </script>




    </div>
    </form>
</body>
</html>
