日期:2014-05-20 浏览次数:20837 次
<table> <tr> <td align="right"> 标题: </td> <td align="left"> <asp:TextBox ID="txtTitle" runat="server" Width="358px"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtTitle" ErrorMessage="*">标题不为空</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> 文件: </td> <td align="left"> <asp:FileUpload ID="FileUpload1" runat="server" Width="197px" /> <asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="上传视频" Width="68px" Height="22px" /> <asp:RegularExpressionValidator ID="imagePathValidator" runat="server" ErrorMessage="*" Text="文件类型不正确" ValidationGroup="vgValidation" Display="Dynamic" ValidationExpression="^[a-zA-Z]:(\\.+)(.asf|.flv|.avi|.mpg|.3gp|.mov|.wmv|.rm|.rmvb)$" ControlToValidate="FileUpload1"></asp:RegularExpressionValidator> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="FileUpload1" ErrorMessage="*" Text="文件不为空"></asp:RequiredFieldValidator> </td> </tr> <tr> <td colspan="2"> 文件类型<span style="color: Red;">(.asf|.flv|.avi|.mpg|.3gp|.mov|.wmv|.rm|.rmvb)</span> </td> </tr> </table>
------解决方案--------------------