Rendering Profile module Edit page rendering

Topics: Customizing Orchard, Writing modules
Nov 19, 2012 at 11:28 AM
Edited Nov 19, 2012 at 11:34 AM

On my site, I'm using profile module and would like to control rendering of profile edit page.

Currently, profile edit page is displayed using following code in the module. (Views/Edit.cshtml.

<h1>Edit Your Profile</h1>
@using (Html.BeginFormAntiForgeryPost()) {

 I'm trying to use an alternate in my theme which displays following code. (mytheme/views/Content.Edit-User.cshtml).

<div class="edit-item">
    <div class="edit-item-primary">
        @if (Model.Content != null) {
            <div class="edit-item-content">
    <div class="edit-item-secondary group">
        @if (Model.Actions != null) {
            <div class="edit-item-actions">
        @if (Model.Sidebar != null) {
            <div class="edit-item-sidebar group">

Can somebody explain how to render this page using typed system?  Just FYI, ProfilePart is added to User content type and there are several custom fields added to the Profile part.

Appreciate help.

Nov 19, 2012 at 1:10 PM
Edited Nov 19, 2012 at 1:11 PM

Hey Tippingpoint, what do you mean by a typed system? Do you not want what is displayed above? or are you looking to just take over the rendering of the view?

to override the actual edit view in your theme to need to override the view by creating a folder called Contrib.Profile in the views folder of your theme... then Home and then the Edit.cshtml file. That's the method to override mvc views.

Nov 19, 2012 at 5:56 PM

I need to be able to take over the rendering of the form and currently I'm using Orchard Shape alternates (mytheme/views/Content.Edit-User.cshtml) to be very precise.

My problem is that by default, I do not get statically typed model as Model and am failing to understand how to control the rendering. I know there's a way to define the @model on the top but what should be qualifier be. Do I need to add any "using" references as well to be able to control the rendering via typed way?

Hope I'm making my problem clear!!!

Nov 23, 2012 at 3:23 AM

If your model is an instance of a static type Foo, just add @Model Foo on top of your view.