0

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:

enctype="multipart/form-data"

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

1 Answer 1

2

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> 
Sign up to request clarification or add additional context in comments.

2 Comments

@Ivan, you still don't see the enctype attribute? That's weird. The helper works perfectly fine for me. There must something else going on with your code.
super, a solution to something ... I am confused

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.