jquery - Passing selected text of dropdownlist through json -


I want to receive the text of the selected option from the dropdown list in the Administrator method. But with the code below, I only get the text not replaced with the initial text.

Data. JasonOflog, which happens prior to the data connection. It gets submitted, the text changes, but this is not the text which the controller has.

In the Controller:

  [http post] Public Jasonurstel Gudsaav (String Jacksonofflag) {<:  

See in:

  & lt; script type = "text / javascript" & gt; $ (Function () {json = {jsonOfLog: $ ("# ddlDocumentType option: selected"). Text ()} $ ('# fileupload'). Fileupload ({dataType: 'json', Content Type: 'Application / Jason ; (URL: '/ Home / GoodSave'), Data: JSON.stringify (json), Add: Function (E, Data) {$ ('# fileuploadbutton'.) Click (function () {data .jsonOfLog = $ ("# DdlDocumentType Options: selected") .text (); data.Submit ();}}}});}); & Lt; / Script & gt;   

Enter image details here <

formData will be changed when you try to upload ...

  & lt; Script type = "text / javascript" & gt; $ (Function () {$ ('# fileupload'). Fileupload ({contentType: 'application / json; charset = utf-8', url: '/ home / gudsaave'}) .on ("fileuploadsubmit", function e , Data) {data.formData = {jsonOfLog: $ ("# ddlDocumentType option: selected"). Text ()};}) $ ("# fileuploadbutton"). ("Click", function () {$ ("#fileupload"). Submit ();});}); & Lt; / Script & gt;   

I do not think you need to pledge the data, so try the above and if it does not work then it should not be necessary as you did prior to strapost as you did before You are crossing data from property names, which must match the parameters in the server method.

This blue file file comes from the upload document ...



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -