473,395 Members | 1,452 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.

Checkmark not saving state on round trip

Even though I have EnableViewState set to true, CheckBox1 is not retaining
its value (false) on page reload.

I have an OnLoad page sub that queries a SQL table for the member's record.

I use Dim bolLoadedOnce As Boolean in the codebehind class for the page.

Then I use:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

If bolLoadedOnce = True Then

Else
fLoadMemberSettings()
bolLoadedOnce = True
End If

End Sub

When I un-tick CheckBox1 it automatically fires a page reload which loads up
CheckBox1 as True again. I want it to remember that I un-ticked it.

Jun 27 '08 #1
2 1147
Get rid of bolLoadedOnce. It 1) doesn't survive postbacks and 2) already
provided by ASP.NET as IsPostBack property.

Use IsPostBack.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Mark B" <no**@none.comwrote in message
news:ul****************@TK2MSFTNGP04.phx.gbl...
Even though I have EnableViewState set to true, CheckBox1 is not retaining
its value (false) on page reload.

I have an OnLoad page sub that queries a SQL table for the member's
record.

I use Dim bolLoadedOnce As Boolean in the codebehind class for the page.

Then I use:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

If bolLoadedOnce = True Then

Else
fLoadMemberSettings()
bolLoadedOnce = True
End If

End Sub

When I un-tick CheckBox1 it automatically fires a page reload which loads
up CheckBox1 as True again. I want it to remember that I un-ticked it.

Jun 27 '08 #2
Thanks.

That did it.

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:On**************@TK2MSFTNGP02.phx.gbl...
Get rid of bolLoadedOnce. It 1) doesn't survive postbacks and 2) already
provided by ASP.NET as IsPostBack property.

Use IsPostBack.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Mark B" <no**@none.comwrote in message
news:ul****************@TK2MSFTNGP04.phx.gbl...
>Even though I have EnableViewState set to true, CheckBox1 is not
retaining its value (false) on page reload.

I have an OnLoad page sub that queries a SQL table for the member's
record.

I use Dim bolLoadedOnce As Boolean in the codebehind class for the page.

Then I use:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

If bolLoadedOnce = True Then

Else
fLoadMemberSettings()
bolLoadedOnce = True
End If

End Sub

When I un-tick CheckBox1 it automatically fires a page reload which loads
up CheckBox1 as True again. I want it to remember that I un-ticked it.

Jun 27 '08 #3

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

Similar topics

4
by: Marc | last post by:
I've gotten everything up and running except for this -- I'd like to be able to have people have a dropdown list of cities in the US to use (or wherever) and not have to input them manually into a...
0
by: charliewest | last post by:
I am using a data grid control to present info on an ASP.NET web form. When clicking buttons, i can show or hide columns and rows, however, this requires a round-trip back to the server. Is...
4
by: John Q. Smith | last post by:
I'm trying to find out some of the details behind OOP state management with SQL Server. For instance - how long does the session object live on any server? Is it created and destoyed with each...
2
by: Brad | last post by:
I have an intranet app that has just started sporadically getting the following error "The viewstate is invalid for this page and might be corrupted." By sproadic I mean 3-4 times during the past...
2
by: Yanir | last post by:
H I have to display a sortable list of columns(a table or so) - by click on the title of a column, the column would be the criteria to sort by I know datagrid is very conveniant, but I want to save...
2
by: Mike | last post by:
Hello, I have a web user control that contains a ListBox. I would like to display some information based on the double-clicking of the user on a ListBox's item. I was thinking about some code...
0
by: Earl Teigrob | last post by:
I am building a custom control that I want to server as a container for child controls that can be dynamically added to this control. I can persist the child controls that are added to my custom...
8
by: needin4mation | last post by:
I understand this is a asp.net group, but thought I would post this here for comments. I admit I have used this post in another group, but it has less traffic. Here's to hoping I'm just blind to...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
7
by: Tony Girgenti | last post by:
Hello. I'm trying to undetrstand ASP.NET 2.0 and javascript. When i have a button and i click on it and i see the web broswer progress bar at the bottom do something, does that mean that there...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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
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...

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.