473,395 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

[asp] remembering values after postback - changes values

Hello,

i have a problem. I created photo as imagemap and i'd like to create
hotspots location depending on some values. So at start i have static
class where i put all values:
class ExtraMethods {
public static int[] xWaw = { 230, 130, 230, 230, 120 };
public static int[] yWaw = { 260, 530, 480, 100, 160 };
}

And after every postback i assign to local variables those values:

private void Page_Load(object sender, System.EventArgs e)
{
if (this.IsPostBack == false)
{
;
}
else
{
xWaw = ExtraMethods.xWaw;
yWaw = ExtraMethods.yWaw;
RecalculatePoints();
}
}
And i have function which recalculate points of hotspots:

public void RecalculatePoints()
{
int[] xTmp = new int[5];
int[] yTmp = new int[5];
int xCenter = 450;
int yCenter = 300;

for (int s = 0; s < 5; s++)
{
xTmp[s] = xCenter - xWaw[s];
yTmp[s] = yCenter - yWaw[s];

xTmp[s] = Convert.ToInt32(xTmp[s] / scale[5 -
ExtraMethods.zoomInOut]);
yTmp[s] = Convert.ToInt32(yTmp[s] / scale[5 -
ExtraMethods.zoomInOut]);

xWaw[s] = xCenter - xTmp[s];
yWaw[s] = yCenter - yTmp[s];

}
}

And this method uses scale factor:

float[] scale = { 1f , 2f , 3f , 4f , 5f };

So, after i start debugging i get everything working fine. But when i'm
going recalcutation my website remember local values: xWaw and yWaw,
even if as i can understand i'm retrieving right info and in the same
time values from this extraclass are changed - nowhere in my code those
values are on the left side of =.
What i'm doing wrong? Maybe somebody can help me?

Thanks

Piotrek
Nov 12 '06 #1
0 1089

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: nospam | last post by:
HtmlSelect has a method called OnServerChange that supposed to detect whether the control (select) has changed on a postback. This is not all that useful. It should be like the asp.net...
11
by: Christoph Boget | last post by:
When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something...
3
by: Francois | last post by:
Hi, First of all sorry for the long post but I believe it is quite an interesting as well as advanced and complex problem. I have a problem with the checkbox control I have in my repeater. I...
2
by: Elliot Rodriguez | last post by:
I have a form that contains a mix of dynamic controls and declared controls. All of them are intrinsic .NET controls. Several functions within the page use Request.Form to query the value of the...
0
by: Piotrek \Alchemik\ | last post by:
Hello, i have a small problem with an operation and remembering values after postback. I have imagemap, where i have some hotspots. After click i'd like to reload image with different one and...
0
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and...
0
by: shamirza | last post by:
· What is view state and use of it? The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested...
2
by: =?Utf-8?B?TG91aXNhOTk=?= | last post by:
Hello. ive just read some posts on the age old issue of losing dynamic control values on postback. Most people say recreate the controls on the onInit, but i just dont think this serves my purpose....
5
by: jehugaleahsa | last post by:
Hello: What is the point of using a DataTable in ASP .NET? We are unsure how you can use them without 1) rebuilding them every postback, or 2) taking up precious memory. We are not sure how to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.