I have an asp.net page which contains a datagrid. I have not enabled paging, so lots of records are displayed on the screen.
The PK of the record is displayed as a link and I have some code which handles the ItemCommand for the datagrid. This code displays a javascript popup (using response.write("<javascript.......etc). The popup is displayed OK, but the page somehow gets refreshed, which means that the screen now displays the top records again (a real pain if you want to select a number of records which are quite a way down the screen).
I've also tested this with a standard web button, positioned a short way down the screen. When clicked (and it basically runs no code), the screen again gets refreshed, and the button disappears. It seems that whenever any server side code is executed (or when the page is posted back to the server) the screen is re-rendered.
Is there any way of stopping this?
Many thanks.
The PK of the record is displayed as a link and I have some code which handles the ItemCommand for the datagrid. This code displays a javascript popup (using response.write("<javascript.......etc). The popup is displayed OK, but the page somehow gets refreshed, which means that the screen now displays the top records again (a real pain if you want to select a number of records which are quite a way down the screen).
I've also tested this with a standard web button, positioned a short way down the screen. When clicked (and it basically runs no code), the screen again gets refreshed, and the button disappears. It seems that whenever any server side code is executed (or when the page is posted back to the server) the screen is re-rendered.
Is there any way of stopping this?
Many thanks.