views:

203

answers:

2

I need fire a filter method with all string in GET or POST value from http request before it was bind into controller action

Can i do it in Global.asax.cs? and if yes, can u give me more details or example (great) about this?

+1  A: 

I believe you can with an action filter.

Try this article.

Kieron
with this how i can get, set value will bind into action parameter
StoneHeart
+2  A: 

You can do it in Global.asax.cs for all requests by

protected void Application_BeginRequest(object sender, EventArgs e) {
   //Look at HttpContext.Current.Request to grab request values 
}

Model binding occurs before action filters run. If you want to write a filter that runs before model binding, you could write an IAuthorizationFilter which runs before model binders.

Haacked