How do I change site?

When I want to click a button to change page it wont work. It worked before :confused:

Code; http://prntscr.com/gzgkmf

How can I change pages now? :frowning:

Hello

You really need to post the full code in order for us to have a look at it. Additionally, as the error message hinted, adding the logs here would be an excellent addition.

This is the whole code, there are no errors just node already have parent.

I don’t know the exact reason or how that is related to the error you’re getting, but removing Layer="Background" from the pages fixes the issue.

If you think about it, that kind of makes sense though. A Page shouldn’t really have a Layer="Background", since that takes a node out of the parent visual tree.

Updated your code:

<App>
    <Router ux:Name="router" />
    <JavaScript>
    var Observable = require("FuseJS/Observable");
    module.exports = {
        gotoFirst: function() {router.goto("firstPage");},
        gotoSecond: function() {router.goto("secondPage");}
    };
    </JavaScript>
    <PageControl ux:Name="pageControl" Active="firstPage">

        <Page Name="firstPage" Color="#64B5F6">
            <Rectangle Name="opacity" Width="70%" Height="50px" Color="#f00" Opacity="0"> 
                <Clicked>
                    <Set pageControl.Active="secondPage" />
                </Clicked>
                <WhileHovering>
                    <Change opacity.Opacity="0.1" Duration="0.2" />
                </WhileHovering>
            </Rectangle>
            <StackPanel Name="clicklist" Width="70%" Height="50px" Color="#0277BD" Opacity="1">
                <DropShadow/>
                <Text FontSize="30" Alignment="Center" Margin="0,10,0,0" TextColor="White">Your Tasks</Text>
            </StackPanel>
        </Page>

        <Page Name="secondPage" Color="#64B5F6">
            <StackPanel Width="100%" Height="100px" Color="#EEEEEE" Alignment="TopCenter"> 
                <DropShadow/>
            </StackPanel>
        </Page>

    </PageControl>
</App>

thanks