Hi,
What I have did so far,
Step 1:
a) Created a view Course and added some textboxes, dropdowns and an actionlink.
@Html.ActionLink("Search", "Search", "Search", new { id = "new-value-link", })
b) Then added a div, which is used to open a partial view as popup
<div id="dialog">
</div>
c) On actionlink click, opened a partial view as popup through jquery
<script type="text/Javascript">
$(document).ready(function () {
$('#new-value-link').click(function () {
var href = this.href;
$('#dialog').dialog({
modal: true,
height: 480,
width: 580,
open: function (event, ui) {
$(this).load(href, function (result) {
$('#idSearchlbx').click(function () {
var retCourseId = $("#idSearchlbx option:selected").val();
$('#dialog').dialog('close');
$.ajax({
type: "POST",
url: "/Course/Course/",
data: { "retCourseId": retCourseId },
dataType: "html",
success: function (evt) {
},
error: function (req, status, error) {
alert("Error!Occured");
}
});
});
});
}
});
return false;
});
});
</script>
d) In partial view,
@Html.ListBoxFor(m => m.SelectedId, new SelectList(Model.Groups, "Value", "Text"), new { id = "idSearchlbx", style = "height:365px;width:550px;" })
On listbox item click, ID of selected item value will be passed to action- controller in parent view (through above mentioned jquery). In that action, I have fetch the details corresponding to that id and return the details as model object. (like return View(model)).But the values are not reflected in view.