I am trying to call C# code within Javascript but it is not working. This is my code:
@{
ViewBag.Title = "Db Maintenance";
}
<script type="text/javascript">
function beginSubmit() {
@{
Console.WriteLine("DELETING.....");
}
}
function cancelConfigForm() {
closeWindow("configDbMaitenanceWindow");
}
</script>
<div>
<button class="k-button k-button-icontext" type="submit" title="Delete Error Records" onclick="beginSubmit()">
<img src="@Url.Content("~/Content/Icons/metro-submit.png")" class="k-icon blank-background" alt="Submit Icon" />Delete Error Records
</button>
<button class="k-button k-button-icontext" type="reset" title="Close the window" onclick="cancelConfigForm()">
<img src="@Url.Content("~/Content/Icons/metro-cancel.png")" class="k-icon blank-background" alt="Cancel Icon" />Cancel
</button>
</div>
"Console.WriteLine" is not even being called. How can I go about callling the C# code on button click?
EDIT I tried
<text>
Console.WriteLine("DELETING.....");
</text>
and it didn't work.