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
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);
}
}
}
this is the error i get
HTTP Error 400.0 - Empty or invalid anti forgery header token. shown below is cshtml and controller file
@using Samit.CmsProTest.Web.Navigation
@{ ViewBag.CurrentPageName = PageNames.Frontend.FeedBack; }
<div class="row"> <div class="col-md-12 page-404"> <div class="number font-red"> @L("FeedBack") </div> <div class="details" style="width:40%"> <form class="feedback-form" action="@Url.Action("FeedBack")" method="post">
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">@L("Name")</label>
<input class="form-control placeholder-no-fix" type="text" placeholder="@L("Name")" name="Name" required value="@Model.Name" maxlength="@Samit.CmsProTest.Authorization.Users.User.MaxNameLength" />
</div>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">@L("EmailAddress")</label>
<input class="form-control placeholder-no-fix" type="email" placeholder="@L("EmailAddress")" name="EmailAddress" required value="@Model.EmailAddress" maxlength="@Samit.CmsProTest.Authorization.Users.User.MaxEmailAddressLength" />
</div>
<div class="form-group ">
<label class="control-label visible-ie8 visible-ie9">@L("FeedBack")</label>
<textarea class="form-control" rows="5" placeholder="@L("FeedBack")" name="Suggestions" required value="@Model.Suggestions"></textarea>
</div>
<div class="form-actions">
<a href="@Url.Action("Index", "FeedBack")"> </a>
<button type="submit" class="btn btn-success uppercase pull-right">@L("Submit")</button>
</div>
</form>
</div>
</div>
</div>
FeedBackController
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);
}
[HttpPost]
[UnitOfWork]
public ActionResult FeedBack(FeedBackViewModel feedBackModel)
{
var model = new FeedBackViewModel();
return View(model);
}
}
}
can you pint me to a page, please
Hello Brother
How can i display site statistics like total number of visitors visited my site.
Regards Anwar
Can you please check help me out here i need to send email from front end pages
Hello
Can you show me how i can send email from a FrontEnd page using EmailSender.
Thanks
Anwar
i have sent my project code, main problem is i think date getting converted to arabic when saving what i mean is i need to set the date to arabic when the language is chnaged to arabic and data entered it saves , but when the same record is edited and dat field not touched and the edited record is tried to be saved it gives an error.
i think when the record for the date to be edited is tied to the daterangepicker with the ng-model, it does display on the form but during save some perhaps error occurs .
Regrads Anwar
yes, it works perfectly for english. brother
Hello
when i open the a data for editing it throws validation error, please note if i change the said date from datetimepicker it saves correctly but if i dont change the date and change any other field it throws this error. also note that the error is from date field only becuase when i commented the date statement in the update function it saves.
also when i did a trace i noticed that the field that is tied to the ng-model if not changed shows value as system.datetime.
thanks Anwar