My client side scripting is rough and I just started with Razor. I haven’t been able to find a way to do the following, where I want to inject a model field value within the onclick confirmation message:
@using (Html.BeginForm("Delete", "ManageLocations", new { id = @Model.Location.Id }))
{ <input type="submit" onclick="return confirm('Are you sure you wish to delete @Model.Location.DisplayLocation ?');" value="Delete">}
What am I missing?
Ooops, stupid mistake…I was embedding this BeginForm within another….The reason this does not work is you cannot have one form nested within another.