Session Variable, Two Clicks

otherside

Centurion
Joined
Mar 16, 2003
Messages
127
Location
UK - Greece
Ok guys this is really stupid, and my mind just stuck now (after about 19 hours of straight coding)

Why on earth do i have to click two times the button to write/load the session variable??? and how can i solve it

the following is a simple example of what i mean, the actual code is quite long :)

Code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        If IsPostBack Then
            TextBox1.Text = Session("Test")
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Session("Test") = TextBox2.Text
    End Sub


I write something to textbox 2 and then i have to press twice to come up in textbox 1 ... please help guys..

thanks
 
that's not the point ;-)
as i mentioned this a simple implementation of a much more complex application.

This server variable is controled by a number of other controls and the central page decides which controls to load based on this variable. I found a solution using the pre render event which is executed right before the rendering

thanks a log guys
 
Back
Top