Problem with updating a datagrid

G

Guest

Hi,
I have a Page1.aspx with a Datagrid which has a link button which spawns a
download of a file. one of the columns shows how man times the files were
downloaded.

The Datagrid is bound to a datasource.

Once the download is done the Datagrid is asked to Databind itself once more
this part does not work. when this code is executed the download is not yet
over and the downloading dialog is still on. please let me know how i can
solve this problem.

I even tried to do a Redirect to the same page. it doesnt work
 
M

Martin Dechev

Hi,

I can suggest you the following:

Add a Literal control to the page. In the Page_Load handler set its Text
property to be an empty string - on every Page_Load, not only when
IsPostBack is false.

Separate the download in another aspx page, that does only this - let's call
it download.aspx.

In the LinkButton.Click handler rebind the DataGrid and set the Text
property of the literal to something like this:

<iframe frameborder="no" src="download.aspx"
style="position:absolute;left:-1;top:-1;width:1px;height:1px;">
</iframe>

Additionally, you can check in download.aspx whether the referer is the page
with the DataGrid.

Hope this helps
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top