This question is locked. New answers and comments are not allowed.
I have a grid on one of my partial views with a template column with anchor text:I want to open up a popup window when the user clicks on the row passing in a parameter.
columns.Template(@<text>
<a
href="javascript:ViewCourse('@item.CourseID')"
onclick="javascrpt:ViewCourse('@item.CourseID')" >@item.CourseName</a>
</text>)
.Width(400)
.Title("Course name");
When I click on the hyperlink on the grid nothing happens. I have the below javascript in the main view.
<script type="text/javascript">
function ViewCourse(CourseID)
{
var url = '@Url.Action("ViewCourse", "CourseCatalog")';
//alert(url);
$.post(url, CourseID,
function (data) {
var window = $('#Window').data('tWindow');
window.content(data);
window.center().open();
});
}
</script>
where Window is declared in the main view:
@(Html.Telerik().Window()
.Name("Window")
.Title("Course Description")
.Buttons(b => b.Maximize().Close())
.Visible(false)
.Modal(true)
.Width(500)
.Height(500)
)
columns.Template(@<text>
<a
href="javascript:ViewCourse('@item.CourseID')"
onclick="javascrpt:ViewCourse('@item.CourseID')" >@item.CourseName</a>
</text>)
.Width(400)
.Title("Course name");
When I click on the hyperlink on the grid nothing happens. I have the below javascript in the main view.
<script type="text/javascript">
function ViewCourse(CourseID)
{
var url = '@Url.Action("ViewCourse", "CourseCatalog")';
//alert(url);
$.post(url, CourseID,
function (data) {
var window = $('#Window').data('tWindow');
window.content(data);
window.center().open();
});
}
</script>
where Window is declared in the main view:
@(Html.Telerik().Window()
.Name("Window")
.Title("Course Description")
.Buttons(b => b.Maximize().Close())
.Visible(false)
.Modal(true)
.Width(500)
.Height(500)
)