hi,
I am using umbraco 7, There will be two pages I created one is home and another is login. I added the login as child under the home page.
When comes to dot net I created one controller and in that I am retrieving the login by using like this
Page=CurrentPage.Children.FirstOrDefault(c => c.DocumentTypeAlias == "login");
I am getting Null value reference
using (var db = new UserDataDbContext("UserData"))
{
var Page = CurrentPage.Children.FirstOrDefault(c => c.DocumentTypeAlias == "ConfirmationPage");
return RedirectToUmbracoPage(Page , "id=" + event.Id);
}
return CurrentUmbracoPage();
}
This is my controller and here I am not getting children page. In this Current page is working and So I created the child page. It is showing the count=0.
Unable to retrieve the children from current page
hi, I am using umbraco 7, There will be two pages I created one is home and another is login. I added the login as child under the home page.
When comes to dot net I created one controller and in that I am retrieving the login by using like this Page=CurrentPage.Children.FirstOrDefault(c => c.DocumentTypeAlias == "login"); I am getting Null value reference
Please anyone help me to solve this problem
Thanks,
I think it would help if we can see the whole controller.
public virtual ActionResult RegisterForm() {
This is my controller and here I am not getting children page. In this Current page is working and So I created the child page. It is showing the count=0.
Why are you using a UserDataDbContext? It's not being used anywhere in your code.
Is your method inheritinh from RenderMvcController, you can't just use a normal MvcController with Umbraco.
If you are new to Umbraco I recommend you to start putting your code in your view and not in a controller, it makes things easier.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.