I'm using Castle windsor DI in my Asp.net Web Forms application. I had follow this link. It seems that everything works fine. However, I'm running into a problem with postback. I have an aspx page that contains an inject property ClientService, a GridView and a Button. I had used this following code in order to feed my GridView :
[Inject]
public IClientService ClientService { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
FeedGridView();
}
}
protected void FeedGridView()
{
grd.DataSource = ClientService.FindAll();
grd.DataBind();
}
It works fine... but when I click to the button that produce a Postback, the GridView disappears. NOTA : this problem turns on just when I'm using DI container. When I had a test without it, the GridView stayed appeared after the Postback.
How to keep the GridView after a postback by keeping the use of Castle windsor?
Regards,