Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Implementing Episerver properties in more than one action method???

Vote:
 

Hi Guys,

        am really firstrate with this,am creating Login page type,controller and views

Login Page type(Login.cs):-

namespace BlogCreation.Models.Pages
{
      [ContentType(DisplayName = "Login", GUID = "b0e4e33f-ffd2-4491-b22e-92f5949879c0", Description = "")]
      public class Login : PageData
      {

          [CultureSpecific]
          [Display(
          Name = "blog heading",
          Description = "",
          GroupName = SystemTabNames.Content,
          Order = 3)]
          public virtual string blogheading { get; set; }

    }

}

LoginController(with two action methods):-

public class LoginController : PageController
{

       public ActionResult Index(Login currentPage)
       {

        return View(currentPage);
        }

         public ActionResult Submit(Login page)
        {
       Return view(page)
        }

}

Now i want to display the blogheading  property in Index.cshtml and Submit.cshtml also, but its displayed in Index.cshtml only,below the UI Code.

Index.cshtml:-

@model BlogCreation.Models.Pages.Login

@{
     Layout = null;
   }


  @Html.PropertyFor(p=>p.blogheading)

Submit.cshtml:-

@model BlogCreation.Models.Pages.Login

@{
     Layout = null;
   }


  @Html.PropertyFor(p=>p.blogheading)

In index view the blogheading displayed properly, but in submit view its not displaying. am unable to find where i did mistake,can anyone helpe me out of this

Thanks,

Ramkee.G

#180105
Edited, Jun 30, 2017 6:59
Vote:
 

Hi,

Change public ActionResult Submit(Login page) to public ActionResult Submit(Login currentPage).

#180114
Jun 30, 2017 9:56
Vote:
 

Thank you Johan petersson,its working fine you saved my day.

Regards,

Kartheek

#180122
Jun 30, 2017 11:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.