I have a Kendo UI grid with a custom column as such:
columns.Template(@<text></text>)
.Width(50)
.ClientTemplate("#= getDeleteHTML(Id, DisplayLocation) #");
It calls a js function to build the html to inject as a form to submit for a delete:
function getDeleteHTML(itemId, itemName) {
var deleteHtml = "<form action='"+ '@Url.Action("Delete", "ManageLocations")'+"/" + itemId +"' method='post'>"
+ "<input type='image' onclick='return confirm(\"Are you sure you wish to delete: \r\n" + itemName + "?\");' value='Delete' class='delete' src='../Images/transparent.gif'>"
+ "</form>";
return deleteHtml;
}
I want to break the confirmation message into 2 lines. I’ve tried \r\n and @Environment.NewLine + itemName as I’m not sure which parser is being used (client or server) in this case.
How can I achieve this?
Have you tried moving confirmation to another function