Baris
Baris

Reputation: 11

Page double refresh

I'm developing a Facebook application. Which is a usual aspx page with a datagrid and a label. When I open the application on Facebook and click on the select button of any row of the grid, page load and "SelectedIndexChanged" server events are called as expected. I am writing a cell value of the selected row, to the label in "SelectedIndexChanged" event. The code behind runs as expected. But after that, Facebook trying to reload the page (calls the page again?). This causes loss of the viewstate (selected row index and label text that set in button click event)

This is weird. Any help would be appreciated.

Regards, Baris

Upvotes: 0

Views: 166

Answers (1)

Baris
Baris

Reputation: 11

I solved this. It was my fault. auth.Authorize() was placed in Page_Load. It was called at all page post backs. Therefore the page was reloading. I wrapped this in if(!Page.IsPostBack) and this solved the problem.

Upvotes: 1

Related Questions