开发者

Remove upload button of FileUpload.GetHtml Helper

How can I remove the upload button helper FileUpload.GetHtml?

    @FileUpload.GetHtml(
        initialNumberOfFiles:1,
        allowMoreFilesToBeAdded:true,
        includeFormTag:true,
        addText:"Adicionar",
        uploadT开发者_如何学Cext:"")


Unfortunately not. The only way to remove it using code is to set includeFormTag to false. But then you'd lose all the rest of the post html. :)

However, since the html output is consistent you can just do a simple replace.

@Html.Raw(FileUpload.GetHtml(
    initialNumberOfFiles:1,
    allowMoreFilesToBeAdded:true,
    includeFormTag:true,
    addText:"Adicionar",
    uploadText:"").ToString().Replace("<input value=\"\" type=\"submit\"/>", ""))

It's rather ugly though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜