M
Morris Neuman
Hi,
I have a page with a wizard control. Note, this page does have a masterpage.
The wizard control has 5 steps; all steps have AllowReturn set to true.
Step 1 allows the user to browse, select and upload a spreadsheet. This
step also has a radiobuttonlist with values set to Fixed or Custom. In the
NextButtonClick script, if the value of the radiobuttonlist is fixed then the
wizard proceeds to step 2 otherwise to step 3 (Wizard1.ActiveStepIndex = 2)
Step2 has a formview with several textboxes . On the Formview, I have a
PreRender event set-up where I set-up default values to be displayed for
these textboxes. The user can update the values in these textboxes as
required then click next to go to Step 3.
Step 3 provides 2 buttons allowing the user additional capabilities. If
during this step the user selects the Previous button to go to step 2, I want
the textbox fields to display the values changed by the user not the default
values. How do I do this?
I tried the following but am having a problem.
I set-up 2 textbox fields on the page outside the wizard to contain the
value of the previous and next step index (textbox 3 is for the previous step
and textbox 4 is for the next step index as follows:
protected void OnActiveStepChanged_SaveCurrPrevIndex(object sender,
EventArgs e)
{
if (IsPostBack)
//NOT first time
{
TextBox3.Text = TextBox4.Text;
TextBox4.Text = Wizard1.ActiveStepIndex.ToString();
}
}
In the formview prerender script I try to check the value of these text
boxes. If the previous step is greater than the current step then I don't
want to display the default values.
protected void FV1_PreRender(object sender, EventArgs e)
{
TextBox tb3 = this.FindControl("TextBox3") as TextBox;
TextBox tb4 = this.FindControl("TextBox4") as TextBox;
int inttb3 = Convert.ToInt32(this.FindControl("TextBox3.Text"));
int inttb4 = Convert.ToInt32(this.FindControl("TextBox4.Text"));
if (inttb3 >= inttb4)
{
FormView FV1 = (FormView)sender;
TextBox tb1 = FV1.FindControl("TextBox1") as TextBox;
tb1.Text = "0";
TextBox tb2 = FV1.FindControl("TextBox2") as TextBox;
tb2.Text = "0123";
}
}
In the code above, I cannot get the values set-in textbox3 and textbox4.
I would like to know how to:
1) Show the default values only the first time the formview is displayed and
then show the values as they are if changed by the user;
2) How to access the textbox3 and textbox4 values in this prerender section.
Thanks as always for your help.
I have a page with a wizard control. Note, this page does have a masterpage.
The wizard control has 5 steps; all steps have AllowReturn set to true.
Step 1 allows the user to browse, select and upload a spreadsheet. This
step also has a radiobuttonlist with values set to Fixed or Custom. In the
NextButtonClick script, if the value of the radiobuttonlist is fixed then the
wizard proceeds to step 2 otherwise to step 3 (Wizard1.ActiveStepIndex = 2)
Step2 has a formview with several textboxes . On the Formview, I have a
PreRender event set-up where I set-up default values to be displayed for
these textboxes. The user can update the values in these textboxes as
required then click next to go to Step 3.
Step 3 provides 2 buttons allowing the user additional capabilities. If
during this step the user selects the Previous button to go to step 2, I want
the textbox fields to display the values changed by the user not the default
values. How do I do this?
I tried the following but am having a problem.
I set-up 2 textbox fields on the page outside the wizard to contain the
value of the previous and next step index (textbox 3 is for the previous step
and textbox 4 is for the next step index as follows:
protected void OnActiveStepChanged_SaveCurrPrevIndex(object sender,
EventArgs e)
{
if (IsPostBack)
//NOT first time
{
TextBox3.Text = TextBox4.Text;
TextBox4.Text = Wizard1.ActiveStepIndex.ToString();
}
}
In the formview prerender script I try to check the value of these text
boxes. If the previous step is greater than the current step then I don't
want to display the default values.
protected void FV1_PreRender(object sender, EventArgs e)
{
TextBox tb3 = this.FindControl("TextBox3") as TextBox;
TextBox tb4 = this.FindControl("TextBox4") as TextBox;
int inttb3 = Convert.ToInt32(this.FindControl("TextBox3.Text"));
int inttb4 = Convert.ToInt32(this.FindControl("TextBox4.Text"));
if (inttb3 >= inttb4)
{
FormView FV1 = (FormView)sender;
TextBox tb1 = FV1.FindControl("TextBox1") as TextBox;
tb1.Text = "0";
TextBox tb2 = FV1.FindControl("TextBox2") as TextBox;
tb2.Text = "0123";
}
}
In the code above, I cannot get the values set-in textbox3 and textbox4.
I would like to know how to:
1) Show the default values only the first time the formview is displayed and
then show the values as they are if changed by the user;
2) How to access the textbox3 and textbox4 values in this prerender section.
Thanks as always for your help.