Url.Action not working [NOT SOLVED]
Hey, I am trying to make a simple popup in which i could fill some info and then save it to database. I am using Url.Action for opening the popup
7 Replies
The problem is
<button type="button" class="btn btn-primary" data-toggle="ajax-modal" data-taget="#addHale" data-url="@Url.Action("Create")">Dodaj</button>
that when i open my website
data-url is empty
this is my controller
its in Controller/HaleController.cs
return PartialView("_HalaPartial");
how can I now create a popup?
I have a _HalePartial.cshtml
inside Views
folder
it looks like this
when I click my button literally nothing happens
i tried
<input type="button" value="Create" onclick="location.href='@Url.Action("Create")'" />
and same effect
location.href is just emptyUrl.Action()
takes two parameters
The first one is the name of the controller
The second one is the name of the actionUse asp taghelper instead?
Something like