<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:variable name="YourNameSpace" select="'命名空间'"/>
  <xsl:variable name="YourTableName" select="'表格名称'"/>
  <xsl:variable name="YourClassName" select="'表格类名'"/>
  <xsl:variable name="YourFieldFristKey" select="'主键字段名'"/>
  <xsl:variable name="YourFristKey" select="'主键属性名'"/>
  <xsl:variable name="YourDataTypeFristKey" select="'主键属性的数据类型(目标语言的数据类型如C#的string)'"/>
  <xsl:variable name="YourFieldFristTitle" select="'标题字段名(默认以第一个文本字段作为标题列和搜索列)'"/>
  <xsl:variable name="YourAuthor" select="'作者'"/>
  <xsl:variable name="YourCreatDate" select="'创建日期'"/>
  <xsl:template match="/">    
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace <xsl:value-of select="$YourNameSpace"/>.Web.Admin
{
    public partial class <xsl:value-of select="$YourClassName"/>Del : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                <xsl:value-of select="$YourNameSpace"/>.BLL.<xsl:value-of select="$YourClassName"/>BLL bll = new <xsl:value-of select="$YourNameSpace"/>.BLL.<xsl:value-of select="$YourClassName"/>BLL();
    if (Request.Params["id"] != null &amp;&amp; Request.Params["id"].Trim() != "")
                {
                    string strId = Request.Params["id"];                   
                    <xsl:choose>
                    <xsl:when test="$YourDataTypeFristKey='int'">
                    int id = Convert.ToInt32(strId);                   
                    </xsl:when>
                    <xsl:when test="$YourDataTypeFristKey='string'">
                    string id = strId;
                    </xsl:when>
                    <xsl:otherwise>
                    int id = Convert.ToInt32(strId);
                    </xsl:otherwise>
                    </xsl:choose>
                    if (bll.Delete(id)){
                      Response.Write("<script>alert('删除成功！');window.location.href='<xsl:value-of select="$YourClassName"/>List.aspx';</script>");
                    }else{
                      // bll.GetLastError();
                      Response.Write("<script>alert('删除失败！');window.location.href='<xsl:value-of select="$YourClassName"/>List.aspx';</script>");
                    }
                }
            }
        }
    }
}
  </xsl:template>
</xsl:stylesheet>