This project is read-only.
1
Vote

Custom form title part and contenttype replacement fter submit

description

Custom form title part and content type are taken from invalid entry if it has not passed validation after submit. Hope you better understand it with an repro steps:
  1. Create ContentType with TitlePart and Required text field.
  2. Create a form for ContentType
  3. Submit a form with empty values -> ValidationSummary is shown, no Title is shown.
  4. Submit a form with some Title but empty required field -> ValidationSummary is shown, Title from submitted value is shown.
Isn't it should show the Custom Form title instead of Content title all the time?

comments

Xeevis wrote Mar 21, 2013 at 2:54 PM

I've encountered same issue, when form is submitted and validation fails the Model.Title in ~/Core/Title/Views/Parts.Title.cshtml is emptied thus empty <title> and <h1> tags.

Xeevis wrote Mar 21, 2013 at 3:00 PM

Temporary solution is to alternate Parts.Title shape with "Parts.Title-url-contact.cshtml" (replace 'contact' with proper page name) and hardcode both strings
@{
    Layout.Title = "My Contact Form";
}

<h1>Contact Form Header</h1>