Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Access ViewData under Page Plugin?
hnchan
#1 Posted : Sunday, May 23, 2010 6:56:33 PM(UTC)
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
vincent
#2 Posted : Tuesday, May 25, 2010 12:14:12 AM(UTC)
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.
hnchan
#3 Posted : Saturday, May 29, 2010 11:17:55 AM(UTC)
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?
luiz@wise.com.br
#4 Posted : Saturday, May 29, 2010 9:40:05 PM(UTC)
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
Users browsing this topic
Guest
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.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.396 seconds.