Shipping plugins configuration with pop up window - BeginForm() helper

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
I'm adding some functionality to ShippingDirector that uses a pop up window/form for file upload.
However, configuration for all Shipping plugins is "wrapped" by Admin Shipping/ConfigureProvider ...

I've been relinquished to hard coding a <form> tag in my view:
<form action="/Admin/Shipping/ConfigureProvider?systemName=Shipping.Director" enctype="multipart/form-data" method="post">

because I was unable to get a BeginForm helper to work - e.g.
@using (Html.BeginForm("Import", null, FormMethod.Post, new { enctype = "multipart/form-data" }))

navigates directly to my controller bypassing the ConfigureProvider wrapper
or e.g. vanilla
@using (Html.BeginForm())

complains that no file is present  (i.e. I need the enctype = "multipart/form-data" )

I can't seem to find a BeginForm overload that works.  Any thoughts?
11 years ago
New York wrote:
I'm adding some functionality to ShippingDirector that uses a pop up window/form for file upload.
However, configuration for all Shipping plugins is "wrapped" by Admin Shipping/ConfigureProvider ...

I've been relinquished to hard coding a <form> tag in my view:
<form action="/Admin/Shipping/ConfigureProvider?systemName=Shipping.Director" enctype="multipart/form-data" method="post">

because I was unable to get a BeginForm helper to work - e.g.
@using (Html.BeginForm("Import", null, FormMethod.Post, new { enctype = "multipart/form-data" }))

navigates directly to my controller bypassing the ConfigureProvider wrapper
or e.g. vanilla
@using (Html.BeginForm())

complains that no file is present  (i.e. I need the enctype = "multipart/form-data" )

I can't seem to find a BeginForm overload that works.  Any thoughts?


Try this

@using (Html.BeginForm(null, null, FormMethod.Post, new { enctype = "multipart/form-data" }))


If you put all null, MVC is clever enough to point to the same page. :D
11 years ago
Thanks, but I had tried that one too.  This gets rendered
<form action="/Plugins/ShippingDirector/Configure" enctype="multipart/form-data" method="post"> 

the action url does not reference the ConfigureProvider
11 years ago
New York wrote:
Thanks, but I had tried that one too.  This gets rendered
<form action="/Plugins/ShippingDirector/Configure" enctype="multipart/form-data" method="post"> 

the action url does not reference the ConfigureProvider


How about this?

@using (Html.BeginForm(null, null, new { systemName = Context.Request["systemName"] }, FormMethod.Post, new { enctype = "multipart/form-data" }))


:D
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.