Put the stuff in the Page_init into the Page_load and put it inside the following condition
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()Panel1.Visible = True
Panel2.Visible = False
Panel3.Visible = False
Panel4.Visible = False
Panel5.Visible = False
Panel6.Visible = False
Panel7.Visible = False
Panel8.Visible = False
End Sub#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Page.IsPostBack ThenEnd If
End SubPrivate Sub btnNext1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext1.Click
If rbl1.SelectedValue = "Individual" Then
Panel1.Visible = False
Panel2.Visible = True
Panel3.Visible = False
Panel4.Visible = False
Panel5.Visible = False
Panel6.Visible = False
Panel7.Visible = False
Panel8.Visible = False
Else
Panel1.Visible = False
Panel2.Visible = False
Panel3.Visible = True
Panel4.Visible = False
Panel5.Visible = False
Panel6.Visible = False
Panel7.Visible = False
Panel8.Visible = False
End If
End Sub
End Class
if( ! Page.IsPostback )
{
Panel1.Visible = True
Panel2.Visible = False
Panel3.Visible = False
Panel4.Visible = False
Panel5.Visible = False
Panel6.Visible = False
Panel7.Visible = False
Panel8.Visible = False
}
else the code that displays #1 will be run every time the page loads... (you only need to give them the initial values, from here the event model and viewstate remembers the settings)
Dunno if this is what you mean!
oops...
A bit fast, didn't see you were using VB... But the example stands!
0 comments:
Post a Comment