Hi David (by the way this relates to the session variables HELP!! problem
that you have already helped me with....)
Do you mean a hyperlink ? If so - how do I store the session variable ?
(recognise the code ;-) )
If you mean a SELECT column with button type: set to linkbutton - it already
is I'm afraid... in fact if I change it to pushbutton the event doesn't seem
to fire in the first place...
I have been messing around with using _SelectedIndexChanged instead as I am
starting to assume that when you click BACK to a page with a grid from a page
that is linked by the _ItemCommand event from that same grid originally, for
whatever reason, _ItemCommand simply doesn't want to play.... However, I
can't work out how to get the value from the datagrid in to Session when
using this event as Ctype(e.item.controls(1), TableCell) is thoroughly not
availale in the same way as under _ItemCommand event - perhaps you have some
thoughts on this ???
I reason that _SelectedIndexChanged may be more accessible in my particular
environment ? (there is much scope for me being wrong on this subject I'm
afraid - so please ignore and supply any other ideas you may have if that is
obvious....)
Thanks for all your help David
"David Jessee" wrote:
I know this sounds strange...but humor me....
Change your button to a Link Button and see if that fixes it
"Stuart" <St****@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com... Hi there
I am using a button column>SELECT and a datagrid.Item_Command to take a
value from the datagrid (in this case a customer account number) - store
that value in to a session variable and transfer to another page which picks up
the session variable and uses it to display information for that
particular customer:
Public Sub CustomerSearchGrid_ItemCommand(ByVal source As Object, ByVal e
As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
CustomerSearchGrid.ItemCommand
If e.Item.ItemIndex >= 0 Then
Dim Ownercell1 As TableCell = CType(e.Item.Controls(1),
TableCell)
UserSession.Current.CurrentAccNumber = Ownercell1.Text & "%"
Server.Transfer("/webapplication/CustomerBasicInfo.aspx")
End If
End Sub
This works great on the first click. However, if I then click on BACK and
choose another customer by clicking SELECT on the datagrid the above event
does not fire - anyone know what I am doing wrong please ???
Thanks very much for your help