Kooboo Forum
»
Kooboo CMS
»
Extension
»
Access ViewData under Page Plugin?
|
Rank: Advanced Member Groups: Registered
Joined: 5/16/2010(UTC) Posts: 36 Location: HK
|
Hello
Could I access the ViewData under the page plugin?
public class RenderContentTemplate : ControllerPluginBase { public override ActionResult PreGetExecute() { ViewData["aa"] = 123; <-- I want to create a view data here.. return base.PreGetExecute(); }
}
Regards
Alex
|
|
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 4/29/2010(UTC) Posts: 62 Location: xiamen
|
You can use Controller.ViewData to access the ViewData in controller.
|
|
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 5/16/2010(UTC) Posts: 36 Location: HK
|
Thanks but could I pass this view data to all of the content template? I found out that we only could use renderContentTemplate("your template name"). Could I make it in more generic way?
|
|
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 3/4/2010(UTC) Posts: 157 Location: brazil
|
You could use the RenderContentTemplate("Content.template",new{param1="X",param2="Y"} to set any property that you created in your content template
|
|
|
|
|
|
Kooboo Forum
»
Kooboo CMS
»
Extension
»
Access ViewData under Page Plugin?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.