8 votes

How to get simple form post to work in Sitecore MVC 8.2?

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 ...
user avatar
  • 13.7k
7 votes
Accepted

Sitecore Custom MVC Form with file upload, file always null

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 (...
user avatar
6 votes
Accepted

Sitecore MVC Form Post with Area

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 ...
user avatar
  • 4,259
6 votes
Accepted

Posting a file to a controller action in Sitecore

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 ...
user avatar
  • 1,693
5 votes
Accepted

How do I do custom forms in Sitecore MVC?

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 ...
user avatar
  • 1,513
4 votes
Accepted

Sitecore SXA action call a controller action

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 ...
user avatar
4 votes

Sitecore 8.1 Controller Rendering Error

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 ...
user avatar
  • 19k
4 votes
Accepted

How to use the AntiForgeryToken with a custom log-in form?

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 ...
user avatar
4 votes
Accepted

Auto populate few fields in Sitecore MVC custom forms

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 (...
user avatar
3 votes

Ajax Begin Form Api Route is different in 10.1

Set "IsCxaSite" to true in "Site Grouping" item for that SXA site and then try to trigger cxa api's.
user avatar
  • 370
3 votes
Accepted

Redirect to a Sitecore Item or Page with ViewModel?

Since we cannot use RedirectToAction() in Sitecore MVC as it interrupts the page rendering process, in this case you can use the RedirectToRoute(), for example using this approach: var item = Sitecore....
user avatar
3 votes
Accepted

Pre-populate form fields in WFFM

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 (...
user avatar
  • 13.7k
3 votes
Accepted

Restricted Home Page showing Layout Requested Not Found

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 ...
user avatar
  • 19.2k
3 votes

How do I do custom forms in Sitecore MVC?

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 ...
user avatar
  • 794
2 votes

Rendering sitecore MVC rendering on an ASPX layout

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 ...
user avatar
2 votes
Accepted

How to load partial view

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....
user avatar
  • 19k
2 votes

WFFM form hidden state on rendering

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

Sitecore Custom MVC Form with file upload, file always null

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 ...
user avatar
  • 4,134
2 votes

Postback Does Not Return Full Page Layout

This code: @Html.Sitecore().FormHandler("Redemptions", "RedemptionForm") is responsible for generation of this HTML <input id="scController" name="scController" type="hidden" value="Redemptions" ...
user avatar
  • 3,436
2 votes
Accepted

Setting up a basic contact form with Sitecore JSS (not using Sitecore Forms)

It is feasible and you just need to expose the API. So, on your react component, you will have a button whereby you will bind it to a function. In that particular function, you can use Axio to call ...
user avatar
1 vote
Accepted

Modify Sitecore form default submit action

You need to create your custom sumbit action: or (if you want to override logic of default submit action) change Model Type of Save Data action (not recommended): You custom submit action should ...
user avatar
  • 3,021
1 vote
Accepted

Get Sitecore From submission attempts

I don't think there is an out-of-the-box solution in Sitecore forms for your scenario. I just checked the conditional logic feature in Sitecore Forms, the IF part of the condition cannot be applied on ...
user avatar
1 vote

'Required if' Validation in Sitecore Forms

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 ...
user avatar
  • 19.2k
1 vote

Sitecore 8.1 Controller Rendering Error

You shouldn't need the / before the action name in your rendering. Change /Index to Index and it should work properly.
user avatar
  • 5,085
1 vote
Accepted

Not all form elements are getting published

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 ...
user avatar
1 vote

Custom.css does not get loaded in Sitecore WFFM mvc

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....
user avatar
  • 17.8k

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