I can`t use jquery much so i need help please. I am using jQuery UI dialog like here. I have Link that opens the dialog where is rendered my partial view.
$(function () {
$("#transferTo").dialog({
autoOpen: false,
height: 100,
width: 300,
modal: true,
resizable: false,
open: function (event, ui) {
$(this).load('<%= Url.Action("TransferTo", "Pacient") %>');
},
buttons:
{
"Transfer": function () {
// do something in database
$(this).dialog("close");
},
"Cancel": function () {
$(this).dialog("close");
}
}
});
$("#transferToLink").click(function () {
$("#transferTo").dialog("open");
return false;
});
});
<a href="javascript:void()" id="transferToLink">Transfer to</a>
Partial view looks like:
<div id="transferTo">
Zmena kliniky
<%= Html.DropDownList("klinika", ViewData["kliniky"] as SelectList)%>
</div>
In the main view there are rows with some data. Each row is user with his id. So what i want to do...
When i click on the link transferTo (it shows after click on Edit link on each row) i need to pass the id of the user to the jquery function and use it on the Click event TransferTo of the dialog. When user clicks on the TransferTo button in the dialog it must take id parameter and selected value from the dropdownlist from dialog and use it in my C# function comunicating with the database (repository.Edit(id,selectedValue))