0

Everything I see about WebHelpers FileUpload is in MVC using Razor. I assume I can use this in a normal aspx page too? I installed the WebHelpers package and I see WebHelpers reference. At the top of my page I have:

<%@ Import Namespace="WebHelpers" %>

Inside my html when I place:

<%=FileUpload.

GetHTML() isn't a valid method but that's all I see in examples. What am I missing?

4

1 回答 1

1

如果您使用的是传统的 Web 表单,最简单的方法是使用FileUploadWeb 控件

<asp:FileUpload id="FileUpload1" runat="server">
</asp:FileUpload>

如果您对使用它不感兴趣,还有许多其他“文件上传”类型的控件(免费和商业)。

据我了解,WebHelpers 与 Razor 视图一起使用,并且我认为将其集成到您的 webforms aspx 页面中并不容易(尽管这篇文章似乎有一种 hacky 方式:Using Web Pages Helpers in ASP.NET Web 窗体)。

于 2013-10-02T15:09:41.317 回答