Detecting a page refresh on a GridView RowCommand

L

Larrybud

Hi All. ASP.Net 2.0

The scenario:
I have a gridview with a template column with a custom rowcommand
image button.

In short, the rowcommand fires some code behind which inserts a
row into a SQL table with some unique values, then does a
RegisterStartupScript which does a window.open. The page in the
window.open logs a user in using the unique values that were saved
in the SQL table and which were passed to the page in the
querystring.

So in effect, this allows an Admin to log in as a user for this
particular site without knowing their credentials. Technically I
could just open a hyperlink, but this wouldn't be secure as the
URL could be copied. With my method, once the page in the
window.open page logs the user in, those unique values are deleted
from SQL, so even if a user could copy the URL, it won't
automatically log the user in.

The Problem:
All of this works fine, except when the page with the gridview is
refreshed after the rowcommand takes place, or if a user navigates
away from that page and goes back. At that point, the rowcommand
is called again, thus opening another new window.

What I need:
So what I need to do is to be able to tell if the RowCommand was a
refresh, or if it was the original click.

Any way to tell? TIA.
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top