M
Michel Couche
I am developing a VB.Net intranet application for the development of
product labels.
This application works with a SQL Server database and, because of the
number of fields, I developed a wizard-like form. I found the background
of the code in the Microsoft "Issue Tracker" Starter Kit.
In a nutshell, controls are loaded dynamically from an array into the
main page (Wizard.aspx)....
.....
Dim WizardSteps As ArrayList = New ArrayList
......
Private Sub Page_Load ....
With WizardSteps
.Add("UControls/1stControl.ascx")
.Add("UControls/2ndControl.ascx")
.Add("UControls/3rdControl.ascx")
.Add("UControls/4thControl.ascx")
.Add("UControls/5thControl.ascx")
End With
So, depending on the index of the array, the controls are added
sequentially one after the other. Every time the user clicks on the
"Next" button, the index is incremented by 1.
So far so good.
But ... how can I retrieve the data typed in by the user? The usual "If
Page.IsPostBack Then ..." in the ascx files does not allow to retrieve
the values.
Indeed when, for example, the page loads the second control, the
"Page.IsPostBack" event of the first control fires (the control itself
is not re-loaded in the main page) but no way to retrieve the values of
the controls of the first control: values like "Txt_XYZ.Text" are all empty.
Any help will be most appreciated
Michel
product labels.
This application works with a SQL Server database and, because of the
number of fields, I developed a wizard-like form. I found the background
of the code in the Microsoft "Issue Tracker" Starter Kit.
In a nutshell, controls are loaded dynamically from an array into the
main page (Wizard.aspx)....
.....
Dim WizardSteps As ArrayList = New ArrayList
......
Private Sub Page_Load ....
With WizardSteps
.Add("UControls/1stControl.ascx")
.Add("UControls/2ndControl.ascx")
.Add("UControls/3rdControl.ascx")
.Add("UControls/4thControl.ascx")
.Add("UControls/5thControl.ascx")
End With
So, depending on the index of the array, the controls are added
sequentially one after the other. Every time the user clicks on the
"Next" button, the index is incremented by 1.
So far so good.
But ... how can I retrieve the data typed in by the user? The usual "If
Page.IsPostBack Then ..." in the ascx files does not allow to retrieve
the values.
Indeed when, for example, the page loads the second control, the
"Page.IsPostBack" event of the first control fires (the control itself
is not re-loaded in the main page) but no way to retrieve the values of
the controls of the first control: values like "Txt_XYZ.Text" are all empty.
Any help will be most appreciated
Michel