javascript:
function OnEdit(link) {
debugger;
if (sectionId != 0 && sectionId != "a") {
link.originalHref = link.originalHref || link.href;
link.href = link.originalHref.replace("-1", sectionId);
}
else if (sectionId == "a") {
alert('Please add section first');
return false;
}
else {
alert('Please select a section to add question');
return false;
}
return true;
}
cshtml:
@if (ViewBag.Type == 1 || ViewBag.Type == 4 || ViewBag.Type == 5)
{
@Html.ActionLink("Arrange", "Arrange", "Question", new { id = 0, sectionid = "-1", assessmentId = ViewBag.AssessmentId }, new { @class = "ancbtnClass editUrl", onclick = "javascript:return OnEdit(this);" })
}
else
{
@Html.ActionLink("Arrange", "Arrange", "Question", new { @class = "ancdisableCss" })
}