Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDNN 8/9 - MVC - Edit module not in edit-mode results in 401DNN 8/9 - MVC - Edit module not in edit-mode results in 401
Previous
 
Next
New Post
1/15/2017 3:48 PM
 

I created a new module from the template module from christoc 'DAL2 MVC Module'. Everything goes very well. I added the new module to my home page and I can add and edit new items when I am in edit Mode. But for my user I want them to edit and add items also in the non edit mode (view Mode). So I changed the following lines of index.cshtml, comment out 'if (Dnn.ModuleContext.IsEditable)' and add an 'add new item' link. Now I can see the links when I am not in edit mode, when I click for example the edit link, I get the popup with the Item properties. But when I want to save the new properties, nothing happens. Fiddler says I got a 401. What am I doing wrong?

@{
//if (Dnn.ModuleContext.IsEditable)
{
<div>
<a href="@Url.Action("Edit", "Item", new {ctl = "Edit", itemId = item.ItemId})">@Dnn.LocalizeString("EditItem")</a>
<a href="@Url.Action("Delete", "Item", new {itemId = item.ItemId})">@Dnn.LocalizeString("DeleteItem")</a>
<a href="@Url.Action("Edit", "Item", new {ctl = "Edit", itemId = -1})">@Dnn.LocalizeString("AddItem")</a>
</div>
}
}

 
New Post
1/30/2017 5:48 PM
 
Are you trying allow save new properties to anonymous users or registered users?

Amarjit Dhunna Dnn Corp.
 
New Post
1/30/2017 8:10 PM
 
I try to save to registered users.
 
New Post
1/30/2017 10:01 PM
 
Make sure you don't have any authorize attribute on the controller or method you are trying to post to.

Amarjit Dhunna Dnn Corp.
 
New Post
2/6/2017 8:46 PM
 
I found out, it has something todo with the "__RequestVerificationToken"wich is not available when I m not in edit modus of the page. But I don't know how to add this to the view mode of my mvc module.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDNN 8/9 - MVC - Edit module not in edit-mode results in 401DNN 8/9 - MVC - Edit module not in edit-mode results in 401


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out