后台代码:
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>
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>
解决方案 »
- 服务器延时任务的执行
- asp.net中,如何把excel中选取内容粘贴至textbox中,同时在GridView或DataList中按原格式显示出来?
- asp.net与asp页面显示区别
- 怎么实现google map这样的程序员
- vsto在哪里下载?我微软网站下载的怎么装上了没有反应呢?有没有c#班的vsto资料?
- DetailsView的HtmlEncode问题
- 一个网站有多个子域名,他们之间的Session可以共用吗?
- WebClient的超级怪问题
- 新手上路:用什么软件写ASP.Net?
- 新建asp.net web 应用程序问题
- 我发现一个可以读出相片光圈快门的网站后台,这个功能如何实现?
- 请教如何在jsp网站下增加一个aspx项目
点击的时候页面也不刷么。?断点打string IsPDF = System.IO.Path.GetExtension(这
看走进来没。