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.
精彩评论