原创  castle的另一种方式的数据传递-->blockcomponent 收藏

通过 blockcomponent将数据压入页面中,在MyFirstComponent类中处理参数

获取方式使用Context.ComponentParameters["Params"];

Example

#component(MyFirstComponent 
"%{firstParam='some value',anotherParam='other value'}")You can then access the parameters from the component code: 

public class MyFirstComponent: ViewComponent
{
    
public override void Render()
    
{
        
object param1 = Context.ComponentParameters["firstParam"];
        
object param2 = Context.ComponentParameters["anotherParam"];

        ...
    }

}

发表于 @ 2006年10月11日 10:50:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:恩和嗯的区别(原创) | 新一篇:Castle错误信息整理

  • 发表评论
  • 评论内容:
  •  
Copyright © delphine
Powered by CSDN Blog