User-633826320 posted
Hi all,
I am a newbie in SPA. I need to know about navigation in SPA. I am confused about that when I read code SPA template. I want a really code sample for this case:
- I have two partical page Home.cshtml and About.cshtml
- I have master page default Layout.cshtml
- I have Home.cshtml with <input
data-bind="value: firstName" /> <input id="Next" data-bind="click: navigateAbout" /> and script get model from API for binding to here by Ko.applyBinding
- I have About.cshtml with <input data-bind="value: aboutName" /> and script get model from API for binding to here by Ko.applyBinding
So how I can navigate from Home to About by updated html in @RenderBody() in Layout.cshtml by clicking button "Next" with navigateAbout() function and execute AboutViewModel script when navigate success ? How I can use Sammy.js or Path.js to store
hash URL #about to navigate About.cshtml when enter in Browser URL ?
Thanks.