如何在MVC Web应用程序中创建自定义文件对话框控件 [英] How to create customize file dialog control in MVC web application

查看:76
本文介绍了如何在MVC Web应用程序中创建自定义文件对话框控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个功能,一旦用户点击浏览按钮文件对话框就会打开。在此对话框中,只显示Excel格式文件,并且在文件类型下拉列表中,在对话框中的打开按钮上方,它应显示在一种格式上,即excel。

所以对于此要求任何人都可以给我一些好的建议。

解决方案

嗨Jameel,



如果你要指定accept = < input>中的.excel标签,你也可以这样做。

- >

< input type =fileid =excelFileaccept =。xlsx命名=一个 uploadFile >< /输入>

I want to create the functionality in which once user clicks on Browse button File dialog box will open. In this dialog box only 'Excel' format file should be display and also in file type dropdown which is just above Open button in dialog box it should display on one format i.e. for excel.
So for this requirement can anybody give me some good suggestion.

解决方案

Hi Jameel,

If you will specify accept=".excel" in <input> tag, you will be able to do the same.
-->
<input type="file" id="excelFile" accept=".xlsx" name="uploadFile"></input>


这篇关于如何在MVC Web应用程序中创建自定义文件对话框控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆