0
avanekar02 created
Hello
how do i call a function from a view in frontend the funtion is defined in the controller as follows
using Abp.Domain.Uow;
using Samit.CmsProTest.School.Courses;
using Samit.CmsProTest.School.Courses.Dto;
using Samit.CmsProTest.Web.Models;
using Samit.CmsProTest.Web.Models.FeedBack;
using System.Web.Mvc;
namespace Samit.CmsProTest.Web.Controllers
{
public class FeedBackController : CmsProTestControllerBase
{
private readonly ICourseDtlAppService _courseDtlAppService;
public FeedBackController(ICourseDtlAppService courseDtlAppService)
{
_courseDtlAppService = courseDtlAppService;
}
public ActionResult Index(FeedBackViewModel feedbackViewModel)
{
var model = new FeedBackViewModel();
return View(model);
}
public ActionResult FeedBack(FeedBackViewModel feedbackViewModel)
{
var model = new FeedBackViewModel();
return View(model);
}
}
}
3 Answer(s)
-
0
Hi,
What you mean by "how do i call a function from a view"? If you explain in detail what you want to do and what is your scenario, then we can help better.
-
0
ok i have created a view in the frontend called feedback and in the controller folder a feedback controller from the view feedback.cshtml i want to accept data and when i submit the form i want an action in the feedback controller to be called..
Thanks Anwar
-
0
If I understand you want to post data from view to action. So you can set your <form> element action attribute, something like following:
<form action="FeedBack/FeedBack" ...