B
bucrepus
I created a simple asp.net web application, with a button.
I declared the var tmpStr
Imports ....
Public Class myClass
dim tmpStr as string
Private Sub Page_Load
check for postback and set tmpStr
if not ispostback then
tmpStr = "ABCDEFG"
'I debug check tmpstr here and it is "ABCDEFG"
end if
end sub
AND THE BUTTON CLICK..
private sub myButton_Click(...)
if tmpStr = "ABCDEFG" then do something..
look at the value of tmpStr and it is empty
end sub
Is it normal for tmpStr to loses its value after pageload. tmpstr is null
when I click the button. MSDN says var. retains its value(lifetime) until
app ends if not a local var.
Thanks KT
I declared the var tmpStr
Imports ....
Public Class myClass
dim tmpStr as string
Private Sub Page_Load
check for postback and set tmpStr
if not ispostback then
tmpStr = "ABCDEFG"
'I debug check tmpstr here and it is "ABCDEFG"
end if
end sub
AND THE BUTTON CLICK..
private sub myButton_Click(...)
if tmpStr = "ABCDEFG" then do something..
look at the value of tmpStr and it is empty
end sub
Is it normal for tmpStr to loses its value after pageload. tmpstr is null
when I click the button. MSDN says var. retains its value(lifetime) until
app ends if not a local var.
Thanks KT