Problem with Sessions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kolags
    New Member
    • Oct 2007
    • 9

    Problem with Sessions

    Hi All,
    I have a datagrid with check box in each row at first column; our requirement is looks like hot mail and yahoo mail working system, after selected mail(s) using check box user can delete mail. In the same way, we would also develop functionality for edit, delete buttons only when checked row from the datagrid.
    I have started like this, whenever I click on the edit button after I selected check box(s), I need to open a popup window only for the checked rows, for this I have created a session in first page and passing the parameters to second page (Popup).

    Edit button
    Dim rowCount As Integer = 0
    Dim mySelection As StringBuilder = New StringBuilder
    Dim DemoGridItem As DataGridItem
    For Each DemoGridItem In DGWHPkg.Items
    Dim myCheckbox As checkbox=CType( DemoGridItem.Ce lls(0).Controls (1, CheckBox)
    If myCheckbox.Chec ked = True Then
    rowCount += 1
    mySelection.App endFormat("'" & "{0}" & "'" & ",", DemoGridItem.Ce lls(2).Text)
    End If
    Next
    lblChosen.Text = mySelection.ToS tring().Substri ng(0, mySelection. ToString().Leng th - 1)
    Session.Add ("Chosen", lblChosen.Text)

    Popup window
    If Not Page.IsPostBack Then
    Dim cScript As String
    cScript = "<script language='javas cript'> opener.location .href = 'WebForm4.aspx' ; </script>"
    RegisterStartup Script("parentw indow", cScript)
    lblChosen.Text = Session.Item("C hosen")

    Now the problem is only few times the session is calling from main page to child (popup) page.
    How to add the session to next page, whenever the edit button clicked?
    But I am unable to do it. Please suggest me how to solve it. Guidance for Delete button too.
Working...