473,406 Members | 2,713 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,406 software developers and data experts.

Remembering Events

I have a form with an <asp:textbox id="name" /> control.
I then have the TextChanged event wired for it. If a
user modifies any text within the control, the event
fires. Within the event handler, I flag that the text
has been modified.

ex.
bool nameModified = false;

name_TextChanged(....){
nameModified = true;
}

Now when the user presses the UPDATE button, I check the
modified flag for each control and if it is true, I
update the database with the new data. All this works
fine.

Problem:
I also have validation controls on the page. In the
following sequence the problem occurs.

1) User modifies the 'name' textbox -- modified flag set.
2) User clicks into another textbox -- for some reason,
the browser refreshes.

When the page reloads, the nameModified flag is reset to
false, as it should be. However, I don't want it to be
reset to false. I want the page to remember that
the 'name' textbox has already been modified.

How can I make it remember? Better yet, how can I stop
the page from reloading when I click out of a control?

-- Prince
Nov 18 '05 #1
1 901
While reading other questions, I accidentally came across
the answer.

Solution: remove the AutoPostBack from the control or set
it to "false".

In case someone else had the same problem.
-----Original Message-----
I have a form with an <asp:textbox id="name" /> control.I then have the TextChanged event wired for it. If a
user modifies any text within the control, the event
fires. Within the event handler, I flag that the text
has been modified.

ex.
bool nameModified = false;

name_TextChanged(....){
nameModified = true;
}

Now when the user presses the UPDATE button, I check the
modified flag for each control and if it is true, I
update the database with the new data. All this works
fine.

Problem:
I also have validation controls on the page. In the
following sequence the problem occurs.

1) User modifies the 'name' textbox -- modified flag set.
2) User clicks into another textbox -- for some reason,
the browser refreshes.

When the page reloads, the nameModified flag is reset to
false, as it should be. However, I don't want it to be
reset to false. I want the page to remember that
the 'name' textbox has already been modified.

How can I make it remember? Better yet, how can I stop
the page from reloading when I click out of a control?

-- Prince
.

Nov 18 '05 #2

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

Similar topics

18
by: | last post by:
Please help. After a number of wrong turns and experiments I need advice on login management system to secure our web pages without inconveniencing our visitors or our internal staff. What I...
0
by: Alex Wolff | last post by:
Hello, How do I keep IIS from caching/remembering username/password? Here is the situation: I have created an asp script which sits on server1. The script makes an http call to server2...
3
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When...
5
by: Ryan Ternier | last post by:
Hey! We need a solution for a problem. We're designing a site where users hate... absolutly hate... with a passion to sign in with a user name / password system. They want to sign in once, and...
2
by: Bill Manring | last post by:
I have an ASP.NET application with many different pages. On one particular page, I would like it to be restored to its previous state if a user navigates away (within the application) and then...
1
by: stefano.troiani | last post by:
Hi, I have a left div where there the menu is, and it is quite long, longer than the web page, so it has a scroll bar. My question is, is there a way to remember the div position once clicked...
5
AMT India
by: AMT India | last post by:
How can I disable the password remembering feature of Browser (Both IE and Firefox) using JS ?
11
by: Mark | last post by:
My browser "remembers" what I typed previously in text fields and gives me a drop-list of "suggestions" as I type. I generally like this feature, but was asked to disable it for a specific text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.