asp.net mvc 2 - how pass data from view to controller (use jquery post)? -


i want when user click on button value of select tag pass action controller

 <select id="typeid" style="font-size: x-small">             <option value="0" selected="selected">--- select---</option>             <option value="1">حقیقی (اشخاص)</option>             <option value="2">حقوقی (شرکت)</option>             <option value="3">دولتی (سازمان)</option>             <option value="4">فروشگاه </option>         </select> 

i use jquery post :

 function passtype() {          var formdata = $("#typeid").val();          alert(formdata);             $.post("/customer/create", formdata, function (data) {             alert(data.tostring());         }, "text");      }; 

but pass null action

this article need read - posting json mvc action:

http://haacked.com/archive/2010/04/15/sending-json-to-an-asp-net-mvc-action-method-argument.aspx


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -