![](/img/trans.png)
[英]Get user information in 2 factor authentication template in Umbraco 8
[英]Is it possible to pass information through a child template to a master template on Umbraco?
我有一個主模板和2個子模板 。 我想將信息從子級傳遞到主模板(每個子模版是不同的頁面)。
可能嗎? 我正在使用7.7.4版的UmbracoCms。
您以為它們是模板,但最后,它們是ASP.NET MVC的View和PartialView。 作為ASP.NET MVC,有兩種選擇:
第一個是使用Section和RenderSection 。
子級: @section NameOfSection { parameterValue }
父級: @RenderSection("NameOfSection", false)
第二個是從HttpContext傳遞信息,但是隨后您必須在使用ParentView中的變量之前調用ChildAction(注意這是一個不好的設計 ,應避免使用它)。 您可以在此處查看更多信息:將數據從部分視圖傳遞到其父視圖
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.