OpenFileDialog in cshtml

后端 未结 1 1333
悲&欢浪女
悲&欢浪女 2021-01-12 17:36

may I know hot can I write something like this c# Opendialog in Razor? I\'m trying to make an openfiledialog that would offer user to upload photo into SqlServerCe database:

相关标签:
1条回答
  • 2021-01-12 18:19

    You can't use a specific OpenFileDialog (a la c#/winforms/wpf) in a web application (without using Silverlight or some other plugin).

    All you can do is use a file input tag, which will cause the browser to open its default file browser dialog box when the user hits the browse button:

    <input type="file" name="elementName" />
    

    When the form is posted, that file will be included as part of the input stream.

    For the full specification of the <input> element, go here: http://www.w3schools.com/tags/tag_input.asp

    0 讨论(0)
提交回复
热议问题