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

Forms State

Dear All,

I have 4 web ASP.net Forms. I use a image control to move between these
forms.The problem I am facing is that I cannot preserve the state of
the form
when moving between different forms. For example, on my first form I
have a
question, a text box and a button. The user sees the question and then
writes
answer in the text box and then presses submit button.as soon as he
presses
submit button his answer is stored in the database and a label control
is
displayed which gives a real correct answer. and on the bottom of the
form is
an image control which has an image of Next question on it. As soon as
the
user presses next question it takes him to a new form. that works
fine.But If I
try to come back to first form.The form reloads.I dont see the
correct answer
label. It looks like the form is REFRESHED and the only thing is can
see is that
question,text box and submit button again.I can't see the label
control which
has the correct answer.
Is there some way I can store the last action of the user between
different
forms.I checked the EnableViewState property of the form but its all
true.
below is some of the code.

Form load Event

If Not IsPostback

label.visible=false
end sub

Button_click
label.visible=true

end sub
Any help much appreciated.

cheers,
Sunil Sabir

Nov 18 '05 #1
1 1368
My guess is you'll have to store the user's responses in session variables
(or other datastore such as a database or XML file). When the page is
loaded it pre-loads with data from the datastore, if datastore is empty,
then the person has not answered the question then display "new/fresh" form.

"Sunil Sabir" <Su********@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
Dear All,

I have 4 web ASP.net Forms. I use a image control to move between these forms.The problem I am facing is that I cannot preserve the state of
the form
when moving between different forms. For example, on my first form I
have a
question, a text box and a button. The user sees the question and then writes
answer in the text box and then presses submit button.as soon as he
presses
submit button his answer is stored in the database and a label control is
displayed which gives a real correct answer. and on the bottom of the
form is
an image control which has an image of Next question on it. As soon as the
user presses next question it takes him to a new form. that works
fine.But If I
try to come back to first form.The form reloads.I dont see the
correct answer
label. It looks like the form is REFRESHED and the only thing is can
see is that
question,text box and submit button again.I can't see the label
control which
has the correct answer.
Is there some way I can store the last action of the user between
different
forms.I checked the EnableViewState property of the form but its all
true.
below is some of the code.

Form load Event

If Not IsPostback

label.visible=false
end sub

Button_click
label.visible=true

end sub
Any help much appreciated.

cheers,
Sunil Sabir

Nov 18 '05 #2

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

Similar topics

25
by: koray | last post by:
hi everyone, in my form i have to take some date information in dd-mm-yy format. but i don't want user to use tabs while typing. for example s/he should simply type 280104 but 28/01/04 must...
1
by: Nicolae Fieraru | last post by:
Hi All, I want to find if there is a different way than the way I am working now. Lets say I have a table, tblCustomers containing address details. I want a report with all the customers from...
18
by: jrhoads23 | last post by:
Hello, I am trying to find a way to tell if an .NET windows forms Button (System.Windows.Forms.Button) is "depressed" (pushed down). For my application, I can not use a check box control set to...
4
by: Greg Burns | last post by:
I have built a web app that uses forms authentication. There isn't a "remember me" feature (i.e. the authentication cookie is not permanent). When you close the browser, and open a new one, you...
3
by: Jessica Loriena | last post by:
I'm trying to write a simple "register form / validate and store in database / show welcome screen" application with ASP.Net. With conventional ASP, I used Session variables and it went something...
4
by: Trevor Andrew | last post by:
Hi There, Hopefully this isn't too difficult a question to express here. I have a 3 tier application. 1. Presentation Tier: ASP.NET web application. 2. Middle Tier: ASP.NET Web Services that...
8
by: Tomasz | last post by:
Hello Developers! I have an interesting problem using my custom MembershipProvider, RoleProvider and Forms Authentication. Both MembershipProvider and RoleProvider require session state, where...
4
by: nottarealaddress | last post by:
I'm trying to get my feet wet in VB2005 (our new standard at work after officially stopping new development in VB6 about a month ago). I'm working with a simple sql 2005 table of 50 entries, one...
7
by: raylopez99 | last post by:
I find that I am using bool variables a lot when I code in Forms. I know how to overload event handlers, and that's great for offloading code from the 'base' event handler and/or creating helper...
4
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i have a main thread an another worker thread. The main Thread creates another thread and waits for the threads signal to continue the main thread. Everything works inside a ModalDialog and...
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: 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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.