.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 19th, 2005, 06:22 AM
summer00 summer00 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 17 summer00 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Problem: Value of a variable is lost on second postback


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT