I have a table that I can't update via a normal FormView (Insert, Update, Edit) process. So I have a FormView that displays the information and I want to populate textboxes outside the FormView with the information in the formview in preparation for a table update done through a stored procedure.
The first code works fine to display the values of the two search textboxes.
The second code is where I'm trying to populate a textbox outside the formview with the current value inside the formview. I get this error:
CS0030: Cannot convert type 'string' to 'System.Web.UI.WebControls
So I took out the "ToString()" part and get this error:
CS0029: Cannot implicitly convert type 'System.Web.UI.WebControls
.TextBox' to 'string'
I simply want to populate the textboxes outside the formview with the values of the texboxes inside the formview so they can modify the ones they need to but not have to retype everything before they run their update. They may only want to change one field and the others stay the same. I know there's a way to do this, I'm just missing it somehow.
protected void btnShowpart_Click(object sender, EventArgs e)
FormView1.Visible = true;
txtNewpartcode.Text = txtPartcode.Text;
txtNewcustnbr.Text = txtCustnbr.Text;
btnShowmodify.Visible = true;
protected void btnShowmodify_Click(object sender, EventArgs e)
Panel1.Visible = true;
txtNewcustpart.Text = ((TextBox)this.FormView1.FindControl("txtCurrcustpart").ToString());