开发者

How to add behavoirs to asp.net mvc 2 action result output

Lets say I have two controllers and two actions.

Controller - > AController Action -> MethodA()

.

Controller - > BController Action -> MethodB()

Both of these return xml data by a View(typedObject).

I want to add base 64 encoding be开发者_运维技巧fore returning this output to the client. On MethodA and MethodB. And there might be some other methods that should be included in this encoding aswell.

Would there be any good way of accomplish an behavoir / treatment of the action result ?

Would it be best to add a custom Action Result for this ?


You could decorate your action with an action filter

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜