Reputation: 2215
DemHere is my textarea control:
<textarea id="Physical_DemandsTextBox" runat="server" cols="35" rows="6" value='<%# Bind("Physical_Demands") %>' />
Here is my logic that works with the other asp:TextBox
controls
if (FormView1.CurrentMode == FormViewMode.Insert)
{
TextBox txtPhyDem = FormView1.FindControl("Physical_DemandsTextBox") as TextBox;
}
if (txtPhyDem != null)
{
txtPhyDem.Text = "Failed Test of the Testing Testers.";
}
When I run the application on insert mode the text area is blank. How do I fix this?
Upvotes: 1
Views: 541
Reputation: 3962
You Just need to replace textarea with textbox control as follow:
<asp:TextBox ID="Physical_DemandsTextBox"
TextMode="MultiLine" Rows="6" Columns="35"
runat="server"
Text='<%# Bind("Physical_Demands") %>'></asp:TextBox>
Upvotes: 1
Reputation: 38608
You could use the Body
property, for sample:
if (FormView1.CurrentMode == FormViewMode.Insert)
{
Physical_DemandsTextBox.Body = "Failed Test of the Testing Testers.";
}
but you also could use directly the asp.net control what is better, for sample, in webform:
<asp:TextBox id="Physical_DemandsTextBox" runat="server"
TextMode="Multiline"
Columns="35"
Rows="6" />
and code behine:
if (FormView1.CurrentMode == FormViewMode.Insert)
{
Physical_DemandsTextBox.Text = "Failed Test of the Testing Testers.";
}
Upvotes: 0