Another Weird Behavior

Juwar

Member
Joined
Jun 13, 2005
Messages
8
Programming Experience
1-3
When I click my submit button, I notice during debug, it goes through my procedures twice! I've never seen this done before! What the heck is going on with this? Here is the code
VB.NET:
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack = False Then
            Session("count") = 1
            hdfqcount.Value = Request.QueryString("question")
            hdfquizid.Value = Request.QueryString("qid")
            hdfuser.Value = Request.QueryString("user")
            hdfseqorder.Value = Session("count")
            Dim qid As Integer
            Dim order As Integer
            qid = hdfquizid.Value
            order = hdfseqorder.Value
            LoadQuestion(qid, order)
        End If
    End Sub

Protected Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click

        RadioButtonList1.Items.Clear()
        Session("count") = Session("count") + 1
        hdfseqorder.Value = Session("count")
        Dim order As Integer = Session("count")
        Dim qid As Integer = hdfquizid.Value
        LoadQuestion(qid, order)

    End Sub
I have changed the ispostback to true, and have the AutoEventWireUp set to false, so I don't know why it's happening...Any help will be appreciated
 
Last edited by a moderator:
Sometimes it's the most idiotic things. I believe .NET has several "bugs" that refer only to the real of "magic", :)

For instance, you could try changing
If Page.IsPostBack = False Then
to
If Not Page.IsPostBack Then
and try it that way.

I know it sounds silly but I've found it several times to make a difference.
Experiment in things like that. Changing bits of code to a slightly different syntax.

Regards,

RVercesi
 
Back
Top