I am trying to pass the whole Model object with one other parameter to js function launchMyActivity(). but the function is not getting it. When I did the aler(passedObject.length)
it is giving unidentified.
I have tried other things but nothing worked.Referred this but didnt worked
I am not sure what is wrong with my implementation.
Model :
public class RequestDTO
{
public HttpRequestBase RequestDto { get; set; }
public List<User> Users { get; set; }
public string ActionId { get; set; }
public string UserSampleID { get; set; }
}
View :
@model RequestDTO
<body>
@Scripts.Render("~/bundle/js/Area/SelectedStudentActivity")
<div class='popOver' style="z-index: 1012;">
<div id='popOverMsg'>Select the student you want to Launch this Activity for:..</div><br /><br />
@foreach(var user in Model.Users)
{
<a id="selectedAnchor" data-id="@user.id" style="cursor:pointer" onclick="launchMyActivity(@user.UserID,@Model)">@user.name</a><br />
}
</div>
</body>
JS :
function launchMyActivity(studentSISId, requestDTO)
{
alert("Lenght : " + requestDTO.length); //I get undefined here
//Below this I need to make AJAX call and pass this requestDTO object.
}