The session variable "foldersXml" is the session variable that finds itself
not available during postback.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.SmartNavigation = False
If Not Me.IsPostBack Then
If Request("keep") Is Nothing Then
GetData()
Else
RefreshData()
End If
SetupUI()
BindData()
Else
RefreshData()
End If
End Sub
Private Sub Page_Unload(ByVal sender As Object, ByVal e As EventArgs)
Handles MyBase.Unload
Session("foldersXml") = folderList.GetXml()
Session("chooserList") = Nothing
End Sub
Private Sub SetupUI()
Me.breadCrumbNav.AddCrumb("Admin",
Me.ResolveUrl("~/admin/adminmain.aspx"), 1)
Me.breadCrumbNav.AddCrumb("Folders",
Me.ResolveUrl("~/admin/folderlist.aspx"), 2)
lblDivision.Text = Me.CurrentDivision.Name.ToUpper()
End Sub
Private Sub GetData()
folderList = B2BFolderFactory.CreateAdminFolders(Me.CurrentDivi sion,
Nothing)
End Sub
Private Sub RefreshData()
'refresh the folder list from the xml string of folder id's
Dim foldersXml As String = CType(Session("foldersXml"), String)
If foldersXml Is Nothing Then
Response.Redirect(Me.REDIRECT_URL)
End If
folderList = B2BFolderFactory.CreateAdminFolders(foldersXml)
'resort a folder if requested ( for name changes from detail page )
If IsNumeric(Request("resort")) Then
folderList.ResortFolder(Convert.ToInt32(Request("r esort")))
End If
End Sub
Private Sub BindData()
maxDepth = folderList.GetMaxDepth()
rptMain.DataSource = folderList
rptMain.DataBind()
End Sub
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:OmzDFeu5DHA.2072@TK2MSFTNGP11.phx.gbl...[color=blue]
> post the code. are you doing anything funny/different? any customizations?
>
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
>
http://tinyurl.com/3he3b
> "PJ" <pjwal@hotmail.com> wrote in message
> news:OHiOris5DHA.2136@TK2MSFTNGP12.phx.gbl...[color=green]
> > I am deifnately not clearing any session variables. I've rebuilt the[/color][/color]
page[color=blue][color=green]
> > piece by piece and it seems to be caused by the DataBind statement on a
> > repeater in the page. I removed all events associated with the repeater[/color]
> and[color=green]
> > set it's DataSource to a simple string array and the same problem still
> > occurred. If I don't databind the repeater, then the session values I[/color][/color]
set[color=blue][color=green]
> > in the Page_Unload event are available on PostBack. If I do, it's like[/color]
> the[color=green]
> > Session variables were never set. What gives?!!?!
> >
> >
> > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
> > news:OZMCOLh5DHA.3896@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > You must be clearing these variables somewhere. Can you verify by[/color]
> > searching[color=darkred]
> > > your project folder that this is not the case? Example, find ALL[/color][/color]
> instances[color=green][color=darkred]
> > > of session and examine them. If all is well, post your code here.
> > >
> > > --
> > > Regards,
> > > Alvin Bruney [ASP.NET MVP]
> > > Got tidbits? Get it here...
> > >
http://tinyurl.com/3he3b
> > > "PJ" <pjwal@hotmail.com> wrote in message
> > > news:u8r1Big5DHA.2740@TK2MSFTNGP09.phx.gbl...
> > > > A particular page seems to be having issues with correctly setting[/color]
> > Session[color=darkred]
> > > > variables. I am setting a couple of session variables on the[/color]
> > Page_Unload[color=darkred]
> > > > event. While stepping through code, the immediate window will show[/color][/color]
> the[color=green][color=darkred]
> > > > values in Session after the relevant lines that set the variables in[/color][/color]
> the[color=green][color=darkred]
> > > > Page_Unload event. However, on postback, these variables are no[/color][/color]
> longer[color=green]
> > in[color=darkred]
> > > > Session. All Session variables that were set previous to that[/color]
> > particular[color=darkred]
> > > > page are still there so I know it's not an issue w/ the aspnet_wp
> > > recyclying
> > > > or all of the Session variables clearing. I'm totally at a loss as[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > > what's going on, if anyone has any ideas, I would love to hear them.[/color]
> > The[color=darkred]
> > > > session state is InProc and the values I am setting are simple[/color][/color][/color]
string[color=blue][color=green][color=darkred]
> > > > values.
> > > >
> > > > TIA~PJ
> > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]