7

The issue is that you are not specifying a ViewName in the return of the SaveValue() action, therefore it is trying to locate a View with the name of the action, i.e. myFeature/SaveValue.cshtml. The error is telling you it could not find this file. You have two options. Either specify the specific view to render for the action: [HttpPost] public ...


7

You need to define your form properly for file uploads to work. The most important part is to set enctype to multipart/form-data. Normally, you should use the standard Html.BeginForm helper: @using (Html.BeginForm("VacancyDetail", "VacanciesController", FormMethod.Post, new { enctype = "multipart/form-data" })) { <input type="file" name="Resume" /> ...


6

Well I must admit before attempting to answer this question, I've never tried to build a form within a separate Area, but I thought it would be easy, so I went ahead and created my own test in my local sandbox environment. Turns out, it was relatively straight forward, but you might run into issues once you start putting this form on more complex pages. So ...


6

In de HttpPost action method, capture your file by using a model object as parameter that has a property of the type HttpPostedFileBase with the same name as your input file field. // The model public class MyModel { public HttpPostedFileBase UploadedFile { get; set; } } // The action method [HttpPost] public ActionResult MyAction(MyModel model) { ...


5

I'd say you can either use the first or second approach. I'm normally using the first approach (the one you got working now) for these sorts of things. What I do is having the same method action defined twice, one for get and one for the post, and in the post version I pass in the ViewModel, which I then rebuild the same way you are doing it. The action ...


4

This question is not SXA specific question. It's Sitecore MVC question. You can see how it's done for Login, Logout renderings. Both of them use Html.BeginForm() helper. The disadvantage of this is that page will reload once you click submit button. At the same time, it is good because there is security protection (@Html.AntiForgeryToken()) against cross-...


4

There are a couple of potential issues here: Set the controller name to the fully qualified class name, e.g MyProject.Controllers.SomeController, MyProject Make sure the action name does not have the / in, it should just be Index It looks like you have not registered your controller with the IoC container. Sitecore 8.2 introduced a lot of new Dependency ...


4

So it depends where you are storing the email. Using xDB If its in the xDB facet, what key did you store the email under. If you stored it under Work Email, you would retrieve it like this. if (Sitecore.Analytics.Tracker.Current.Contact != null) { var emailFacet = Tracker.Current.Contact.GetFacet<IContactEmailAddresses>("Emails"); //Check ...


3

You can use the Rules Engine, there are a bunch of out-of-the-box rules that allow you to set the default field value based on a number of conditions: If you need to set the value to something else (i.e. values from your external source) then you can create custom a RuleAction that retrieves that values. Be a little careful with your action though and try ...


3

I have an old support ticket with a confirmed bug by Sitecore Support (on Sitecore 6.5 and 8.0) that a homepage with broken inheritance can lead to a no-layout error. We did get a patch for it (number 325160). If applicable, you should be able to get it from Sitecore Support as well. I did find the issue as fixed in the release notes of Sitecore Experience ...


3

I found the root of the issue. It was caused by some controller actions, for which: Either the [ValidateRenderingToken] attribute was missing; Or the [ValidateRenderingToken] attribute was added after the [ValidateAntiForgeryToken] attribute, thus changing the execution order.


3

The first option is the one I have used mostly. But for some form submissions we wanted to have the page context as we had to pull data source of some other rendering on the page. So, my two cents would be Check if you need page context, if so, pass in the page GUID to be handy If possible use MVC Ajax posts to restrict full page reload and exchange only ...


2

Have a read of this blog post that explains how to use MVC layouts on Webforms pages: https://blog.horizontalintegration.com/2015/09/15/mixing-sublayout-with-rendering-webforms-with-mvc-request/. It references a couple of examples such as the one you mentioned. The solution consists of a Extension Method for the Sublayout: public static class ...


2

You can't submit an MVC form in the standard MVC way when using Sitecore. You have to do some specific things. Method 1: Sitecore().FormHandler First, your razor view needs to change from using Ajax.BeginForm to Html.BeginRouteForm and then passing in the Sitecore route name. Like this: @using (Html.BeginRouteForm(Sitecore.Mvc.Configuration.MvcSettings....


2

I am able to resolve this by Reinstalling WFFM CM package on server Republishing all WFFM related items Clear the Sitecore Cache


2

You need to specify an enctype of multipart/form-data if your form uses file input types. You can either do this manually: <form action="" enctype="multipart/form-data" method="POST"> Or by using the HtmlHelper, but you would need to use the particular overload that allows you to specify HTML attributes: @using (Html.BeginForm("Action", "Controller"...


1

At the moment, that is not possible ootb. So you will need a custom validation. My own blog post could be a start (https://ggullentops.blogspot.com/2017/10/sitecore-9-forms-custom-validation.html) but there is also documentation on the Sitecore docs (https://doc.sitecore.com/developers/91/sitecore-experience-management/en/walkthrough--creating-a-custom-...


1

This code: @Html.Sitecore().FormHandler("Redemptions", "RedemptionForm") is responsible for generation of this HTML <input id="scController" name="scController" type="hidden" value="Redemptions" class="has-text"> <input id="scAction" name="scAction" type="hidden" value="RedemptionForm" class="has-text"> When there are present 2 values in POST ...


1

You shouldn't need the / before the action name in your rendering. Change /Index to Index and it should work properly.


1

please make sure that your Form items are correctly pushed to Web DB - test at your CM in the published mode as well. If the behavior is still different from CM to CD in publish mode, then it has to be something with files instead of items. In that case, please make sure to compare your DLLs and Views between CM and CD. If they are not identical, please ...


1

if you want to load CSS from custom files you need to include into : \Website\Views\Form\Index.cshtml. This is a content of the file: @using Sitecore.Form.Core.Configuration @using Sitecore.Forms.Mvc @using Sitecore.Forms.Mvc.Html @model Sitecore.Forms.Mvc.ViewModels.FormViewModel @{ ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = Model.ClientId; ...


Only top voted, non community-wiki answers of a minimum length are eligible