Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Detecting a page refresh on a GridView RowCommand

Reply
Thread Tools

Detecting a page refresh on a GridView RowCommand

 
 
Larrybud
Guest
Posts: n/a
 
      01-14-2009
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView RowCommand event not firing!! Kevin Attard ASP .Net 8 05-28-2008 11:04 PM
GridView RowCommand problem: GridView Nested in Repeater HeavyMetal ASP .Net Web Controls 0 08-08-2006 01:17 PM
Help: GridView RowCommand Event intercepts RowDeleting Event keithb ASP .Net 1 06-09-2006 11:39 PM
Asp.NET Composite Control with GridView, RowCommand doesn't work Zule ASP .Net 1 03-15-2006 06:51 PM
GridView ButtonField RowCommand Image/Button problem nx-2000@winvoice.com ASP .Net 0 11-23-2005 10:54 PM



Advertisments