Hi,

I have a form that has two controls; a textarea and an upload, one of which is hidden depending upon the selection of a dropdown. What I'm trying to do is alter the action of the form depending on which control is hidden. so if the textarea is visible the form would look like

Html.BeginForm("TextAreaAction", "ControllerName", new { id = @Model.Id }, FormMethod.Post, new { enctype = "multipart/form-data" }))

or if the upload was visible it would read

Html.BeginForm("UploadAction", "ControllerName", new { id = @Model.Id }, FormMethod.Post, new { enctype = "multipart/form-data" }))

Can anyone point me in the right direction?

Thanks

I should use the same mvc action that uses a two private voids or functions to process the 2 different tasks. Seems most straight forward to me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.