开发者

MVC form with parametars:

开发者 https://www.devze.com 2023-04-02 03:58 出处:网络
I use fileuploader Jquery, I tried to form defined as follows: <Form enctype="multipart/form-data" action="<%:Url.Action("Edit","Ticket")%>" method=&qu

I use fileuploader Jquery, I tried to form defined as follows:

<Form enctype="multipart/form-data" action="<%:Url.Action("Edit","Ticket")%>" method="post" >

using

(Html.BeginForm("Edit","Ticket",  new { ticketOnEdit = Model }, FormMethod.Post, new { enctype = "multipart/form-data" })){}

Each of these ways is defined html form:

<form class="MultiFile-intercepted" method="post" action="21359" id="form1">

I do not have a parameter:

encty开发者_JS百科pe="multipart/form-data"

How to solve a given problem, if someone can let me show what went wrong?


The following will generate the correct form:

<% using (Html.BeginForm("Edit", "Ticket", new { ticketOnEdit = Model }, FormMethod.Post, new { enctype = "multipart/form-data" })) { %>
    ...
<% } %>

Like this (assuming of course default routes):

<form action="/Ticket/Edit" enctype="multipart/form-data" method="post">
    ...
</form>
0

精彩评论

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