I have developed a website using visual studio 2008. Which uses active index to navigate from one page to the next page.
It will increment the index when the user clicks the next button. According to the incremented value , next pages has been navigated
There is a drop down in the first page with values (A,B,C,D)
Normally, Website navigate in the the following way
Page1-->page2-->Page3-->Page4 and so on..
But if value "B" in a drop down box in Page1 which result in the following flow.
Page1-->page2-->Page4
But the problem is ... Website is acting strange. It gives following flow..
Page1-->page2-->Page3-->Page4 instead of Page1-->page2-->Page4 for that particular value selection (value "B") in drop down selection.
This issue is happening, when user goes to the last page again come to the front using back button and go the last page using “next “button. (Multiple iterations causing this issue)
Two things i need here :
- Why it is occurring?
- How to prevent this
I have given the code below :
Thanks for the help in advance
Protected Sub btn_view1_back_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_view1_back.Click, btn_view2_back.Click, btn_view3_back.Click
Try
Dim currentView As Int16
currentView = mvRequestorForm.ActiveViewIndex
If currentView = 3 And BSelected() = 1 Then
mvRequestorForm.ActiveViewIndex = (currentView - 2)
Else
mvRequestorForm.ActiveViewIndex = (currentView - 1)
End If
If mvRequestorForm.ActiveViewIndex = 1 Then
If (ddl_view0_WULValue() = 0) Then
'C'
CSelected() = 1
strRoleType = "chkBx_C_workunit"
ElseIf (ddl_view0_WULValue() = 1) Then
'head office'
ASelected() = 1
strRoleType = "chkBx_A_workunit"
ElseIf (ddl_view0_WULValue() = 2) Then
'B'
BSelected() = 1
strRoleType = "chkBx_B_workunit"
ElseIf (ddl_view0_WULValue() = 3) Then
'B'
BSelected() = 1
strRoleType = "chkBx_B_workunit"
End If
End If
Catch ex As Exception
End Try
End Sub
Code for Next button below :
Protected Sub btn_View0_Next_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_View0_Next.Click, btn_View1_Next.Click, btn_view2_Next.Click
Try
Dim currentView As Int16
currentView = mvRequestorForm.ActiveViewIndex
If currentView = 1 And BSelected = 1 Then
mvRequestorForm.ActiveViewIndex = (currentView + 2)
rfv_view2_managersEmail.Enabled = True
rev_view2_managersEmail.Enabled = True
Else
mvRequestorForm.ActiveViewIndex = (currentView + 1)
End If
If mvRequestorForm.ActiveViewIndex = 1 Then
Sub_ActivateView1()
End If
Catch ex As Exception
End Try
End Sub