I've just created a new facebook app, and all works fine, except controller actions which handle the "post" from my app, with [FacebookAuthorize] filter on action; since it creates a redirect and all of my form data is lost. You can see what I am talking about if you modify the only form presented in this tutorial:
http://www.asp.net/mvc/tutorials/mvc-4/aspnet-mvc-facebook-birthday-app
<form class="navbar-form pull-right" action="@Url.Action("Search", "Home")"
method="get">
<input class="span2" type="text" name="friendName" placeholder="Friend's name" />
<button type="submit" class="btn">Search</button>
</form>
If I change form's method to "post", the parameter in my Search method in controller is no longer filled. I did some research on this, and it seems that FacebookAuthorize filter creates a redirect and loses all post-data. How to make a workaround, or am I doing something wrong?
The action is here:
[FacebookAuthorize]
[HttpPost]
public async Task<ActionResult> Search(string friendName, FacebookContext context)
{
return null;
}
When I place a breakpoint inside, I can see that parameter friendName is empty.