
January 19th, 2005, 06:22 AM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 17
Time spent in forums: 18 m 14 sec
Reputation Power: 0
|
|
|
Problem: Value of a variable is lost on second postback
Hi everyone,
I found that the value of a variable(string type for example) is lost after the aspx page postback.
E.G:
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
abc = "xyz";
}
private void Command1_Click(object sender,System.EventArgs e)
{
Response.Write(abc);
}
I have assigned the abc value to "xyz" , but after i click the command button, i found that the value of abc is lost. The code " Response.Write(abc)" shows nothing .May i know what's wrong with it ? Thx a lot
|