responding to option.checked in a user control ?

N

news.microsoft.com

I have a user control with four option buttons depending which option button
is pressed I store a score into session object. On the load event of a
control the session object is set to 0. There is an optionchecked handler
that handles option1.checked,option2,checked etc . This is supposed to
update the sessionobject with a score ie 100

A beak point on the handler shows it is never reached. when this control is
placed on a page

Any idea what I have to do to get the current score from the control.

What I am after is a for each instance of the control on the page, add up
the score to produce a total score.

code of the control is:

any assistance would be appreciated ?



Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'as this is multiple choice there is one question with up to four possible
answers

'Each answer has a score assigned to it

'when the question is anwered the total score is calculated for the question
and

'returned in the total Score property for the question



Session("TotalScored") = 0







End Sub

#Region "Properties"



Property QuestionID()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property question()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property Answer1()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property Answer2()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property Answer3()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property Answer4()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property Score1()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property Score2()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property Score3()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property Score4()

Get

End Get

Set(ByVal Value)

End Set

End Property

Property TotalScored()

Get

End Get

Set(ByVal Value)

End Set

End Property

#End Region





'Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOK.Click

' TotalScored = _Score1 + _Score2 + _Score3 + _Score4

' Me.Visible = False

'End Sub

Private Sub Option_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Option1.CheckedChanged, Option2.CheckedChanged,
Option3.CheckedChanged, Option4.CheckedChanged

Session("TotalScored") = Session("TotalScored") + 100

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top