开发者

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

开发者 https://www.devze.com 2023-02-01 11:25 出处:网络
Lets say I have two controllers and two actions. Controller - > AController Action -> MethodA() . Controller - > BController

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

精彩评论

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