not sure if this is possible or if i am down the wrong road.
i am wanting to use an attribute to clean out single quotes from my form posted data (this will be changed, but single quotes is a good example)
i have created the actionFilter as below:
public class RemoveSingleQuotesAttribute : ActionFilterAttribute
{
public NameValueCollection collection { get; set; }
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
for (int i = 0; i < collection.Count; i++)
{
collection.Set(
collection.GetKey(i),
collection.GetValues(i).ToString().Replace("'","`")
);
}
}
}
now this is where i get stuck:
when i type [RemoveSingleQuotes()] in brackets i only get [Int Order] as the intelisense and not formcollection/Namevaluecollection
and also how do i pass a collection anyway ?????
is this even possible or am i just creating some mad sh*t up here ????
thanks