CheckedChanged event - how do I make it work?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

It seems that the following code should work - (if not why is the event there?)
(Do I need some sort of client side script to awaken it?)

Private Sub chkRefresh_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles chkRefresh.CheckedChanged
If chkRefresh.Checked = True Then
Me.txtRefreshDate.Text = ""
Me.txtRefreshDate.Enabled = False
Else
Me.txtRefreshDate.Enabled = True
End If
End Sub
 
Hello, jonefer,

The code works fine for me. (I'm assuming that it is in the Form that
contains chkRefresh and txtRefreshDate.)

Can you be more specific about what the problem is.

Cheers,
Randy
 
That is correct - I'd like it to happen each time the box is checked
(visually) or unchecked.

It is a control panel for an administrative user of the website.
This portion is what will automatically put up a 'not available' page
whenever data is being refreshed.


The user has 2 choices
1. Check the Refresh Checkbox - and provide the time that the site will be
available again.
or
2. Uncheck the box, in which case the 'Refresh date' should have a valid
date in the past.
that the user enters.

More explicitly, I'm inserting a date of "#1/1/2207#' into the actual
(txtRefreshdate) field whenever the box is checked - and hiding that effect
from the user - that date is my cue to put up a 'Not Available' page.

If the user unchecks the box - only then do I want the txtRefreshDate to be
available.

Checking and unchecking the box must visually cue the user what is available.
And I can't seem to make that work.

when the box is checked - they should only see a 'Time Available' box
when the box is unchecked - they should only see a 'Refresh Date' box

THEN the user can click 'submit'
 
Hello, jonefer,

Sorry, but I haven't done any work with web pages. Is the problem that
the event handler does not get called when the check box state is changed?

Cheers,
Randy
 
Yes. The problem is that nothing happens when the checkbox gets changed.
I only notice it when the page first opens.
 
Hello, jonefer,

Is the AutoPostBack property of the CheckBox set to True? If not, try this.

Cheers,
Randy
 
Back
Top