后台代码:
    protected void btSubmitCourseStandard_OnClick(object sender, EventArgs e)
    {
        string IsPDF = System.IO.Path.GetExtension(FileUploadCourseStandard.FileName).ToString().ToLower();
        if (FileUploadCourseStandard.HasFile == false || IsPDF != "pdf")
        {
            Response.Write("<script>alert('请选择PDF格式文件!')</script>");
            return;
        }
    }
前台代码:
<head runat="server">
    <title>课程标准</title>
    <script type="text/javascript" src="../Js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../Js/jquery.jmpopups-0.5.1.js"></script>
<script type="text/javascript">
//<![CDATA[
$.setupJMPopups({
screenLockerBackground: "#003366",
screenLockerOpacity: "0.7"
}); function openStaticPopup() {
$.openPopupLayer({
name: "myStaticPopup",
width: 400,
target: "myHiddenDiv",
eventType:"click" 
});
}
//]]>
</script>
    <style type="text/css" media="screen">
#myHiddenDiv {display:block;}
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="myHiddenDiv">
<table style=" width:300px; height:130px; border-bottom-color:Red;" border="1px" cellspacing="0" cellpadding="0" align="center">
 <tr>
    <td style=" width:220px; height:30px" align="left">上传课程标准:(PDF)</td>
        <td style=" width:80px; height:30px;" align="center">
            <label style="color:Blue; font-size:15px;" onclick="$.closePopupLayer('myStaticPopup')">关闭</label>
        </td>
     </tr>
     <tr>
        <td style=" width:220px; height:100px;" align="center">
            <asp:FileUpload ID="FileUploadCourseStandard" runat="server" />
        </td>
        <td style=" width:80px; height:100px;" align="center">
            <asp:Button ID="btSubmitCourseStandard" runat="server" Text="上传" OnClick="btSubmitCourseStandard_OnClick" />
        </td>
     </tr>
</table>
</div>